password =123
count=0while count<3:
in_password=int(input("please input your password:"))
#in_username=input("please input your username:")if in_password == password:print("welcome to our home")break
elif in_password < password:print("think bigger...")else:print("think smaller...")
count+=1if count ==3:print("you input too much time")
for循环,猜大小
password =123for i inrange(3):
in_password=int(input("please input your password:"))if in_password == password:print("welcome to our home")break
elif in_password < password:print("think bigger...")else:print("think smaller...")else:print("you input too much time")
任意玩,猜大小
password =123
count=0while count<3:
in_password=int(input("please input your password:"))if in_password == password:print("welcome to our home")break
elif in_password < password:print("think bigger...")else:print("think smaller...")
count+=1if count ==3:
continue_gass=input("do you want to try again?")if continue_gass !="n":
count=0