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)
feet = input("length in feet")
inches = 12 * float(feet)
length = float(inches) * 2.54
print("The length is" + " " + str(length) + " " + "centimeters")
Error
32
451
4447
False is the opposite of true