- 2
Can anyone convert this code into while loop?
import time def pos (username, burger_type, quantity): print() print(time.strftime( '%:%M %p, %a, %d/%b/%Y')) print("NAME:", username) if burger_type=='big': quan=quantity amount=quan*100 GST_Amount = (amount*13)/100 net_Price + GST_Amount elif burger_type=='small': quan=quantity amount=quan*100 GST_Amount = (amount*13)/100 net_Price = amount+ GST_Amount print("BRUGER TYPE :" ,burger_type) print("QUANTITY:",quantity) print("AMOUNT:",amount) print("GST(13%)AMOUNT:",GST_Amount) print("TOTAL AMOUNT: " , net_Price) name = 'Max' type = 'small' quantity = 2 pos(name, type, quantity)
4 Respuestas
+ 2
What for?
+ 1
ask your friend
+ 1
SAfiullaH KhoKhar The most important skill required for programming is logic thinking. Using while loops, or any structure, depends on what you want the code to do.
You showed a code and asked people to use a specific loop, knowing absolutely nothing about what it should do. How is someone supposed to help at all?
If the only reason for using while is that your friend has it, then I back Slick answer - your friend is the only one who can help.
0
Coz my friend has this