如何在python3中使用带有函数的while循环

时间:2018-03-08 20:06:53

标签: python-3.x

d20 = random.randint(1, 20)# <----- Twenty sided die roll

if d20 >= 16:
    print(d20)  # <-----This is for testing purposes
    print('Got em\'!!')
else:
    print(d20)  # <-----This is for testing purposes
    print('Missed!!!, Got bank around and try again we cannot land until 
           they are cleared out!')

def failedAttack():#<------Function for failed attack roll.
    print(d20)  # <-----This is for testing purposes
    print('Missed!!!, Got bank around and try again we cannot land until they are cleared out!')

failedAttack()

我想在failedAttack条件为真时让d20 <= 15函数重复,否则shell将print('Good shooting, we got em\'!!')

0 个答案:

没有答案