p = 0
order = input('Enter no of items and category: ').split()
while order != ‘STOP’:
if order[1] == ‘A’:
if int(order[0]) < 30:
p = p + int(order[0])*15
elif int(order[0]) <99:
p = p + int(order[0])*12
else:
p = p + int(order[0])*10
order = input('Enter no of items and category: ').split()
else:
if int(order[0]) < 50:
p = p + int(order[0])*30
elif int(order[0]) < 99:
p = p + int(order[0])*25
else:
p = p + int(order[0])*20
order = input('Enter no of items and category: ').split()
else:
print(order)
ERROR - when I input stop, I get this error
IndexError Traceback (most recent call last)
Input In [36], in <cell line: 3>()
2 order = input('Enter no of items and category: ').split()
3 while order != ‘STOP’:
----> 4 if order[1] == ‘A’:
5 if int(order[0]) < 30:
6 p = p + int(order[0])*15
IndexError: list index out of range