+ 2
Hi can ,someone please be kind enough to tell me if this code works after submitting input. The goal is to get a bill of items .
IP=[10.00,12.00,15.00,10.00,25.00,45.00,50.00,25.00,10.00,12.00] total=0 Foodtype=int(input('Enter Food type')); while (foodtype>0); Q=int(input("Enter Quantity")) total=total+Foodtype*Q print (total)
4 Answers
+ 2
There are some syntax errors, like space before "while", semi colon after foodtype..., And semicolon in place of colon in while loop.
Then your while loop will never end if foodtype >0.
Then you are not using IP, idk what's it for, and even if you fix the while loop this is not going to give you a bill of items.
+ 5
Nethmi Pallekankanamge ,
here some additional hints:
since my text exceeds the number of allowed characters, i have put it in a file.
https://code.sololearn.com/cINJgeia8UMZ/?ref=app
+ 1
Lothar Thank you very much âš
0
Lucifer Thank you âš