- Joined
- Sep 14, 2022
- Messages
- 2
- Reaction score
- 0
So this is just the bare beginning of a program that's supposed to calculate either the days passed in the month or the year, depending on the user's choice. My problem is in the choice() function, I'm getting a bad input error on the second if statement. Ive tried changing it to an elif, and an else, and I'm getting the same error. Anyone know how to fix this?
Python:
#define functions
def choice(c):
if c == 1:
#funton for days passed in month
if c == 2:
print("lol")
#fucntion for days passed in year
def leap_year(year):
if year/4 == 0:
return 1
if year/4 != 0:
return 0
#main
print("Please enter a date")
day = input("Day: ")
month = input("Month: ")
year = ("Year: ")
print("Menu:")
print("1) Calculate the number of days in the given month.")
print("2) Calculate the number of days passed in the given year")
choice = input()
choice(choice)