while 语句
num=17
while True :
guessNumber=int(input("nunber:"))
if guessNumber==num :
print("guessnumber=num")
break
elif guessNumber>num :
print("guessnumber>num")
else:
print("guessnumber<num")
while else语句
# -*- coding: utf-8 -*-
__author__ = 'Bao'
num=17
times=0 #输入次数
while times < 3 :
times+=1
guessNumber=int(input("nunber:"))
if guessNumber==num :
print("guessnumber=num")
break
elif guessNumber>num :
print("guessnumber>num")
else:
print("guessnumber<num")
else:
print('You have input too many times.bye!')
for 循环
for i in (1,2,3,10) :
print(i)
for i in ('a','b','c') :
print(i)
for i in range(1,11) :
if i==5 :
continue
print(i)
pass
空语句,没有任何需要执行的语句,就写pass