This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("I will tell you how days, weeks and months you have left, if you were to live until 90 years old.\n") | |
age = int(input("How old are you? \n")) | |
years_left = 90 - age | |
days_left = years_left * 365 | |
weeks_left = years_left * 52 | |
months_left = years_left * 12 | |
print(f"You have {days_left} days, {weeks_left} weeks and {months_left} months left.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Tip and Bill Calculator") | |
bill = float(input("What is the total bill?\n")) | |
tip = int(input("What percentage tip would you like to give: 10, 12, 15 or 20?\n")) | |
people = int(input("How many people to split the bill?\n")) | |
# Get the percentage | |
tip_percentage = tip / 100 | |
# The the tip amount |
OlderNewer