Hey guys, here's the homework for week 2. Solutions will be posted later this week. If you have any problems or questions, be sure to let us know.
Homework:
Write a program that takes two inputs and stores them in the variables feet and inches. Print output of their height in centimeters. (12 inches = 1 foot, 1 inch = 2.54 centimeters)
What do these print?
(“99” - 8) % 6
int(5.8) + float(9) * 3
4 + int(“447”)
str(4) + “447”
str(bool(0)) + “ is the opposite of ” + str(bool(25))
Resources
Class slides: https://docs.google.com/presentation/d/1ZUl6aCzJc6HFCNRWgVy9EiNh8KM2Kw6zqM4VDY8oscc/edit#slide=id.g155f1b6c9e0_0_568
Class code: https://replit.com/@ShravyaS/IntrotoPython-Class2#main.py
Discord: https://discord.gg/28D6hGXP
Contact info:
shravyassathish@gmail.com (mentor)
kingericwu@gmail.com (TA)
felixguo41@gmail.com (TA)
print("Please input your height! ")
feet = input("Put in your feet: ")
inch = input("Put in your inches: ")
height = 12*int(feet)+int(inch)
heightFinal = height*2.54
print(f'You are {heightFinal} cm tall!')
a: error
b: 42.0
c: 451
d: 4447
e: False is the opposite of True