Quick actions

cmd+k|ctrl+k

Navigation

Languages

quangtranhong - pyfml - Exercise 3.5

Snippet info

Language

Python

Visibility

public

Author

quangtranhong

Created

2016-09-21T04:39:54Z

Updated

2016-09-21T07:53:13Z

# Bài 3.5
# -------

# Input: một số nguyên trong range(1,13).
# Output: tên tương ứng của tháng đó bằng tiếng Anh, và số ngày trong tháng đó.
# Tháng 2 tính 28 ngày.

# Ví dụ:

# - input: 2

# - output: February 28

input = 3

if input == 1:
    month = 'January'
    days = 31
elif input == 2:
    month = 'Febuary'
    days = 28
elif input == 3:
    month = 'March'
    days = 31
elif input == 4:
    month = 'April'
    days = 30
elif input == 5:
    month = 'May'
    days = 31
elif input == 6:
    month = 'June'
    days = 30
elif input == 7:
    month = 'July'
    days = 31
elif input == 8:
    month = 'August'
    days = 31
elif input == 9:
    month = 'September'
    days = 30
elif input == 10:
    month = 'October'
    days = 31
elif input == 11:
    month = 'November'
    days = 30
elif input == 12:
    month = 'December'
    days = 31
else:
    print('Invalid input')

print('Input: ', input)    
print('Output: ', month, days)
INFO