Preparing git repo for final project

This commit is contained in:
2023-07-09 11:19:26 +02:00
parent 6a38966eef
commit 63d06d6b35
67 changed files with 1587 additions and 0 deletions

17
problems/pset0/tip/tip.py Normal file
View File

@@ -0,0 +1,17 @@
def main():
dollars = dollars_to_float(input("How much was the meal? "))
percent = percent_to_float(input("What percentage would you like to tip? "))
tip = dollars * percent
print(f"Leave ${tip:.2f}")
def dollars_to_float(d):
return float(d[1:])
def percent_to_float(p):
return float(p[:-1])/100
if __name__ == "__main__":
main()