Simple code but a a bit of an odd issue. Python tends to print the brackets and coma in the print function. This only happens in row 5 and row 7 but not for the last row. Any idea what's wrong?
e.g. output for each row:
(2016, is a leap year)
(2015, is not a leap year)
Invalid year.
year_str = input("Please enter a numerical year: ")
year = float(year_str)
if year == int(year) and year > 0:
if (year/4)==int(year/4) and (year/100)!=int(year/100) or (year/400)==int(year/400):
print(year_str, " is a leap year.")
else:
print(year_str, "is not a leap year.")
else:
print("Invalid year.")