本文共 403 字,大约阅读时间需要 1 分钟。
以缩进符和冒号标志语块:
#!/usr/bin/python
#Filename: if.pynumber = 23
running = Truewhile running:
guess = int(input('Enter an integer : '))if guess == number:
print('Congratulations,you guessed it.') print('(but you do not win any prizes!)') running = False elif guess < number: print('No,it is a little higher than that') else: print('No,it is a little lower than that') else: print('the while loop is over.')转载地址:http://vtkzl.baihongyu.com/