Python--if 、while、for

###if判断
# age_wj = 28
# age = int(input('Please enter my age:'))
#
# if age == age_wj:
# print('Yes! you are right')
# elif age < age_wj:
# print('No! too small try again')
# else:
# print('No! too big try again')


###while循环
# age_wj = 28
# count = 0
# while count < 3:
# age = int(input('Please enter my age:'))
# if age == age_wj:
# print('Yes! you are right')
# break
# elif age < age_wj:
# print('No! too small, please try again')
# else:
# print('No! too big, please try again')
# count += 1
# else:
# print("You don't have a chance")

# age_wj = 28
# count = 0
# while count < 3:
# age = int(input('Please enter my age:'))
# if age == age_wj:
# print('Yes! you are right')
# break
# elif age < age_wj:
# print('No! too small, please try again')
# else:
# print('No! too big, please try again')
# count += 1
# if count == 3:
# count_try = input("Whether or not to continue...")
# if count_try != 'n':
# count = 0
# else:
# print("You don't have a chance")


###for循环
# age_wj = 28
# count = 0
# for i in range(3):
# age = int(input('Please enter my age:'))
# if age == age_wj:
# print('Yes! you are right')
# break
# elif age < age_wj:
# print('No! too small, please try again')
# else:
# print('No! too big, please try again')
# count += 1
# else:
# print("You don't have a chance")

# for i in range(10):
# if i<5:
# print("loop", i)
# if i==4:
# print("呵呵...")
# else:
# continue
posted @ 2020-07-12 16:12  WJ-HAHA  阅读(42)  评论(0)    收藏  举报