RunestoneInteractive / fopp

Foundations of Python Programming
https://runestone.academy/runestone/static/fopp/index.html
38 stars 120 forks source link

semantic error w/time example #252

Closed irunestone closed 5 years ago

irunestone commented 5 years ago

Error reported in course agnes_ac101f19a on page KnowyourerrorMessages by user agnes312 cdepree+agnes312@agnesscott.edu In Active Code: 6 (ac4_7_6) Original code does not actually compute the time of day.

Original code - n = input("What time is it now (in hours)?") n = imt(n) m = input("How many hours do you want to wait?") m = int(m) q = m % 12 print("The time is now", q)

New code suggestion - n = input("What time is it now (in hours)?") n = int(n) m = input("How many hours do you want to wait?") m = int(m) sum_time = n + m time_of_day = sum_time % 12 print("The time is now", time_of_day)