Forum Comments

6/8 - Homework Week 1 Day 1
In Introduction to Python
chiao_chuanhung
Jun 09, 2022
username = input("What is your name? ") hasSiblingStr = input("Do you have sibling? True or False: ") hasSibling = eval(hasSiblingStr) numOfSibling = 0 if hasSibling: numOfSibling = int(input("How many sibling do you have? ")) Age = input("How old are you? ") Age = int(Age) candyName = input("What is your favorite candy? ") isAteAlready = input("Have you ate one today? yes or no: ") if isAteAlready == "yes": ateToday = True else : ateToday = False weight = input("How many lbs do you weight ? ") '''print(type(weight))''' w=int(weight) if ateToday : verb ="have" else: verb = "haven't" print("----------------We start to analyzing you---------------") print('Hi '+ username +' How are you doing today?') print(f"You have {numOfSibling} sibling") print(f'you are {Age} years old') if Age<=12: print("You are a kid") elif Age <=18: print("You are a teenager") elif Age<=45: print("You are an adult") elif Age<=80: print("You are old") else: print("You are too too old") print("Your favorite candy is "+ candyName +" you "+verb+ " eaten candies today") print("your weight is "+weight) if w > 90: print(f'You are overweight. It is never too late to quit {candyName}') else: print("your weight is fine. But "+candyName+" are not good for your teeth. Please eat more apples")
0
0
C

chiao_chuanhung

More actions