Question #21159

write a python program that asks the user to enter a number of books that he or she has purchased this month and displays the number of points awarded

0 book = 0 point
1 book= 5 points
2 books = 15 points
3 books = 30 points
4 books = 60 points

Expert's answer

num = int(raw_input('Enternumber of books: '))
if num == 0:
print 'Points: 0'
elif num == 1:
print 'Points: 5'
elif num == 2:
print 'Points: 15'
elif num == 3:
print 'Points: 30'
elif num == 4:
print 'Points: 60'
else:
print 'Points: ???'
LATEST TUTORIALS
APPROVED BY CLIENTS