if
number = 23
guess = int(input('请输入数字:'))
if guess == number:
print('你输入对了')
elif guess < number:
print('你输入小了')
else:
print('大了')
print("Done")
while
while number <= 3 :
print(number)
number = number + 1
函数
def sayHello():
print("你好! Hello! おはようございます!")
sayHello() # 你好! Hello! おはようございます!
def sum(a,b):
return a + b
print(sum(1,2)) # 3
def say(message,time="12"):
print(message + " " + time)
say("message") # message 12
def func(a,b=5,c=10):
print('a is',a,'and b is',b,'and c is',c)
func(25) # a is 25 and b is 5 and c is 10
网友评论