《Python人工智能——基础篇》第一期 lesson1_homework

print("Welcome!\n原味***3元\n香蕉***5元\n草莓***5元\n蒟蒻***7元\n珍珠***7元") num_tea=input("please input a number from 1 to 5 to choose your drink:") if int(num_tea)>=1 and int(num_tea)<=5: if num_tea=="1": name_tea="原味" price_tea=3 elif num_tea=="2": name_tea="香蕉" price_tea = 5 elif num_tea=="3": name_tea="草莓" price_tea = 5 elif num_tea=="4": name_tea="蒟蒻" price_tea = 7 elif num_tea == "5": name_tea = "珍珠" price_tea = 7 amount_tea=int(input("please input the amount:")) member_tea=input("are you a member?If you are,input 1,if not,input 2:") if int(member_tea)==1: member_tea="Yes" result_tea = price_tea * amount_tea*0.9 else: member_tea="No" result_tea=result_tea=price_tea*amount_tea print("*******Welcome to hadoop teahouse!*******") print("\tThe drink you choosed is:{}\n\tThe price is:{}".format(name_tea,price_tea)) print("\tThe amount is:{}\n\tMember or not?:{}\n\tThe total price is:{}".format(amount_tea,member_tea,result_tea)) print("*****************************************") else: print("Woops!我们只售以上五种奶茶哦!新口味敬请期待!")