On day 10 of the 100 days of python course, we covered functions with output (using the return keyword)
# what's wrong with
this code??
def format_name(f_name, l_name):
f_name = input("Enter your first name: ").title()
l_name = input("Enter your last name: ").title()
return
f_name + "
" + l_name
print(format_name(f_name,
l_name))
My Leap Year Checker
Code:
def is_leap_year(year):
if
year % 4
== 0:
leap_year = True
if year % 100 == 0:
leap_year = False
if year % 400 == 0:
leap_year = True
else:
leap_year = False
return leap_year
print(is_leap_year(2000))
Comments
Post a Comment