Edit typos and grammar and add python files
This commit is contained in:
parent
c1222a8103
commit
991caf0521
16 changed files with 285 additions and 3 deletions
20
thinkcspy/Chapter-2-Exercises/Python-Files/problem3.py
Normal file
20
thinkcspy/Chapter-2-Exercises/Python-Files/problem3.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Runestone.Academy thinkcspy course
|
||||
# Chapter 2
|
||||
# Problem 3
|
||||
|
||||
|
||||
currentTime = input('What time is it?')
|
||||
currentTime = int(currentTime)
|
||||
|
||||
waitTime = input('In how many hours do you need to wake up?')
|
||||
waitTime = int(waitTime)
|
||||
|
||||
print('It is currently', currentTime,'.')
|
||||
print('You need to wake up in', waitTime, 'hours.')
|
||||
|
||||
# My solution was more long winded than the actual answer, but it still works!
|
||||
totalTime = currentTime + waitTime
|
||||
time24hr = totalTime // 24
|
||||
alarmTime = totalTime - 24 * time24hr
|
||||
|
||||
print('The alarm has been set for', alarmTime, '.')
|
||||
Loading…
Reference in a new issue