Jump to content

Python - Cheat Sheet

From Squishu Wiki

General

  • xxx

Print

  • print("Hello Douches")

F-Strings

print(f"Your bill is {bill}.  Your tip percentage is {tip}.  The tip for each of {people} people will be {mytip}.")

Input Statements

  • input("What's your name")

Comments

  • Use a #blah

Round money to two decimal places

  • final_amount = round(bill_per_person, 2)