Á¤¼ºÈÆ
    ½Ç½À Ãß°¡ ¹®Á¦ 1 (¸ð¹ü ´ä¾È)



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def is_leap_year(year):
    # If year is divisible by 4
    if year % 4 == 0:
        # If year is also divisible by 100
        if year % 100 == 0:
            # If year is divisible by 400, it's a leap year
            if year % 400 == 0:
                return True
            # Divisible by 100 but not by 400, not a leap year
            else:
                return False
        # Divisible by 4 but not by 100, it's a leap year
        else:
            return True
    # Not divisible by 4, not a leap year
    else:
        return False
 
# Input from the user
year = int(input("Enter a year: "))
 
# Check if the year is a leap year
if is_leap_year(year):
    print(f"{year} is a leap year.")
else:
    print(f"{year} is not a leap year.")
cs

 

Á¶°ÇÀ» °£´ÜÇÏ°Ô ÇÑ ÁٷΠǥÇö

1
2
3
4
5
6
7
8
9
10
11
12
13
14
def is_leap_year(year):
    if (year % 4 == 0 and year % 100 != 0or year % 400 == 0:
        return True
    else:
        return False
 
# Input from the user
year = int(input("Enter a year: "))
 
# Check if the year is a leap year
if is_leap_year(year):
    print(f"{year} is a leap year.")
else:
    print(f"{year} is not a leap year.")
cs

  µî·ÏÀÏ : 2024-04-04 [00:43] Á¶È¸ : 53 ´Ù¿î : 0   
 
¡â ÀÌÀü±Û½Ç½À Ãß°¡ ¹®Á¦ 1
¡ä ´ÙÀ½±ÛµµÀü¹®Á¦ 3.2
Python for AI ½Ç½À°Ô½ÃÆÇ
¹øÈ£ ¨Ï Á¦ ¸ñ Á¶È¸ µî·ÏÀÏ
Anaconda3 ¼³Ä¡
ColabTurtlePlus
½Ç½À ¸ñ·Ï
Colab ½Ç½À
½Ç½À ½Ã ÇлýµéÀÌ ÀÚÁÖÇÏ´Â ½Ç¼ö ¿¹µé
60 ¦¦❶ lcode_4_6.py (±³Àç) 612 02-20
59    ¦¦❷ lcode_4_6_3.py (±³Àç) 684 02-20
58    ¦¦❷ lcode_4_6_2.py (±³Àç) 527 02-20
57    ¦¦❷ lcode_4_6_1.py (±³Àç) 504 02-20
56 ¦¦❶ lcode_4_5.py (±³Àç) 579 02-20
55 ¦¦❶ lcode_4_3.py (±³Àç) 665 02-20
54 (3Àå) ¿¬»êÀÚ·Î °è»êÀ» Çغ¸ÀÚ 836 02-19
53 ¦¦❶ ¨Õ½Ç½À Ãß°¡ ¹®Á¦ 2 122 04-04
52    ¦¦❷ ½Ç½À Ãß°¡ ¹®Á¦ 2 (¸ð¹ü´ä¾È) 44 04-04
51 ¦¦❶ ½Ç½À Ãß°¡ ¹®Á¦ 1 106 04-04
50    ¦¦❷ ½Ç½À Ãß°¡ ¹®Á¦ 1 (¸ð¹ü ´ä¾È) 53 04-04
49 ¦¦❶ µµÀü¹®Á¦ 3.2 993 03-14
48    ¦¦❷ µµÀü¹®Á¦ 3.2 (¸ð¹ü ´ä¾È) 640 03-14
47 ¦¦❶ µµÀü¹®Á¦ 3.1 869 03-14
46    ¦¦❷ µµÀü¹®Á¦ 3.1 (¸ð¹ü ´ä¾È) 679 03-14
45 ¦¦❶ lch3.ipynb (¿¹Á¦ Àüü) 777 03-01
44 ¦¦❶ llab_3_5.py (±³Àç) 605 02-20
43 ¦¦❶ llab_3_4.py (±³Àç) 937 02-20
42 ¦¦❶ llab_3_3.py (±³Àç) 543 02-20
41 ¦¦❶ llab_3_2.py (±³Àç) 597 02-20

[1] [Prev]-[11][12][13][14][15][16][17][18][19]