Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
85543 彭士宝 08判断是否为闰年 Python3 Compile Error 0 MS 0 KB 273 2024-07-17 20:10:46

Tests(0/0):


Code:

def is_leap_year(year): if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0): return "Yes" else: return "No" year = int(input("Enter the year: ")) if is_leap_year(year) == "Yes": print(f"{year} Yes") else: print(f"{year} No")


Run Info:

  File "Main.py", line 8
    print(f"{year} Yes")
                      ^
SyntaxError: invalid syntax