I need help fixing this code and am quite new to python
print('Welcome')
totalTaught = []
for x in range(7):
try:
print('How long did you teach on day ', x + 1, '?')
timeTaught = input()
totalTaught.append(int(timeTaught))
except ValueError:
print('No Numerical Value Given')
totalTaught.append('No Numerical Value Given')
if timeTaught >= 20 and <= 30:
print('Good job!')
elif timeTaught <= 20:
print('Try more next time...')
elif timeTaught >= 30:
print('Dont overwork your students...')
for x in range(0, 7):
print('On day', x + 1, 'you taught for ', totalTaught[x], ' minutes')
Posted Aug 15, 2020, 3:22 PM UTC
15
After input block you should calculate sum of teaching time from list of times (totalTaught) and then evaluate sum. In current version you use instead of sum the list itself. This doesn't work.
ohh thx
how do i do that though?
[deleted]
Similar to this https://pastebin.com/jES3QkvL