+ 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)

27th Nov 2022, 3:20 AM
Nethmi Pallekankanamge
Nethmi Pallekankanamge - avatar
4 odpowiedzi
+ 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.
27th Nov 2022, 4:23 AM
Lucifer
+ 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
27th Nov 2022, 3:47 PM
Lothar
Lothar - avatar
+ 1
Lothar Thank you very much ✨
14th Dec 2022, 2:25 AM
Nethmi Pallekankanamge
Nethmi Pallekankanamge - avatar
0
Lucifer Thank you ✨
14th Dec 2022, 2:24 AM
Nethmi Pallekankanamge
Nethmi Pallekankanamge - avatar