[Tutor] using the loop function while another
acolle00 at g.uafortsmith.edu
Tue Oct 9 21:47:35 CEST 2012
Ok, here is my problem. If a person has two different people to order
books for, then when using the loop option, How do you add the two seperate
choices together for a final total of books cost?
while another=='y' or another=='Y':
another=input('Do you have another book to order for this student?
'Enter y for yes: ')
book=int(input('Enter the book chioce you want: ' +\
'For Hardback Enter the number 1: ' +\
'Paperback Enter the number 2: ' +\
'Electronic Enter the number 3: '))
num=int(input('Enter how many you need: '))
print('Your book cost is $ ',format(b_total,'.2f'))
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor