Learn to Code via Tutorials on Repl.it!

← Back to all posts
Try this its working, any suggestions on how to make it more compact??
ShivamRastogi2

print("Welcome to the tip calculator!!")

bill_b = input("What was the total bill?" + " " + "$")

tip = input("What percentage tip would you like to give? + 10, 12, or 15? ")

tip1 = float(tip)

percentage = tip1/100 + 1

bill_amount = float(bill_b) * percentage

num_people = input("How many people to split the bill? ")

each_share = bill_amount/int(num_people)

r_ound = round(each_share, 2)

print(f"Each person shall pay: ${r_ound}")

Voters
RtoonTV
AmoghTheCool
ShivamRastogi2
Comments
hotnewtop
ShivamRastogi2

Btw in the code line of what percentage tip you want you can put any amount except 10/12 or 15 its just for the purpose of the project I had to specify the tip amount