salespercent = int(input("what is the total bill?: "))
#Prompt the user for the # of people plitting th bill
nopeople = int(input("How many people are splitting thee bill?: "))
print("/n")
#Calculate the value each person owes based on the bill
payment_per_person = ("%.2f" % round(float(((salespercent / 100 +1) ' totalbill) / nopeople), 2))'
salespayment = "%.2f" % float(salespercent / 100 ' totalbill)
print(f"Tip amount: $(salespayment)")
totalbill = float(totalbill)
salepayment_float = float(salespayment)
total = (totalbillfloat+salespayement_float)
print(f"Total bill including tip: $(total)")
print(f"Each person owes: $(payment_per_person)")```
#What am I missing?
48 messages · Page 1 of 1 (latest)
@next geyser
❌ Formatting - Invalid Input
Cannot parse: 9:68: payment_per_person = ("%.2f" % round(float(((salespercent / 100 +1) ' totalbill) / nopeople), 2))'
totalbill = float(input("what is the total bill?: "))
salespercent = int(input("what is the total bill?: "))
#Prompt the user for the # of people plitting th bill
nopeople = int(input("How many people are splitting thee bill?: "))
print("/n")
#Calculate the value each person owes based on the bill
payment_per_person = ("%.2f" % round(float(((salespercent / 100 +1) ' totalbill) / nopeople), 2))'
salespayment = "%.2f" % float(salespercent / 100 ' totalbill)
print(f"Tip amount: $(salespayment)")
totalbill = float(totalbill)
salepayment_float = float(salespayment)
total = (totalbillfloat+salespayement_float)
print(f"Total bill including tip: $(total)")
print(f"Each person owes: $(payment_per_person)")
Oh there's definitely some kinda formatting error somewhere on salespayment line
Or payment_per_person
@fringe bone Why are you using strings on those lines?
100 ' totalbill
or salespercent / 100 +1) ' totalbill) / nopeople), 2))'
I thought it was supposed to be like that
I kinda just started coding yesterday so I'm looking for help everywhere
This is supposed to be Python, right?
yeah
ohhhhhhhhhhhhh
Not $(...)
bruhhhh
And, what calculation is this supposed to be?
salespercent / 100 ' totalbill
What I'm trying to do is
1.- Make a Program in python to Calculate the Tip Amount of a Restaurant Bill. Make option is you are going to Pay alone or Split the Charges.
Yeah, checked your other help channel as well
But, salespayment = "%.2f" % float(salespercent / 100 ' totalbill)
What are you trying to do with this line?
Python uses ' for strings
And % is modulo
okay so that's what was wrong.
There's a lot going on with that code that's not even Python
Basically, everything after this:
totalbill = float(input("what is the total bill?: "))
salespercent = int(input("what is the total bill?: "))
#Prompt the user for the # of people plitting th bill
nopeople = int(input("How many people are splitting thee bill?: "))
print("/n")
Walk me through what are the payment_per_person and salespayment lines supposed to do?
I was wondering why the visual studio was tripping
Also, you can just use an empty print to get an empty new line
!exec
print("Hello")
print()
print("world!")
@next geyser
✅ Exec - Success (Super User 🦸)
Hello
world!
!exec modules | Completed in 0.0274 milliseconds
("%.2f" % round(float(((salespercent / 100 +1) ' totalbill) / nopeople), 2))'
What's this calculation trying to do?
you know what? I stopped trying that one and went back to original one because that one seemed more complicated
so lets just not talk about it
it never happened
but i think i'm done with the other one
but i'm having trouble getting the last string to be apart of the other 2 strings
actually no only one of them is responding now