Category : calculator

Below is a copy of my simple tip calculator: bill_total = float(input("What is your total?n")) people_total = float(input("How many people are splitting the bill?n")) tip_percent = float(input("What percent tip would you like to leave?n")) total = (bill_total + (int(bill_total*(tip_percent/100))))/(people_total) print("Everyone should leave about $" +'{:.2f}’.format(round(total, 2))) How would I go about concatenating a "%" sign ..

Read more

Building a simple calculator for my first Python project and encountered a question shown in the comments below: special_keys = ["`", "~", "!", "@", " ", "#", "$"] while True: num1 = input("Enter First Number: ") if num1.isalpha(): print("Invalid, Try Again.") continue # elif num1 contains an element or part of an # element in ..

Read more