Remove .md and image files and move python files into main chapter folders
This commit is contained in:
parent
5978779a9a
commit
67806dab6a
159 changed files with 0 additions and 4562 deletions
20
thinkcspy/Chapter-2-Exercises/problem3.py
Normal file
20
thinkcspy/Chapter-2-Exercises/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