1. while语句
2. range语句
例:
#while example
number = 59guess_flag = False
while guess_flag == False:
guess = int(input('Enter an integer : '))
if guess == number:
# New block starts here
guess_flag = True
# New block ends here
elif guess < number:
# Another block
print('No, the number is higher than that, keep guessing')
# You can do whatever you want in a block ...
else:
print('No, the number is a lower than that, keep guessing')