winter_list = [1,2,12]
spring_list = [3,4,5]
summer_list = [6,7,8]
Autumn_list = [9,10,11]
N = int(input())
def check(winter_list, spring_list, summer_list, Autumn_list):
if N in winter_list:
time = 'winter'
elif N in spring_list:
time = 'spring'
elif N in summer_list:
time = 'Summer'
else:
time = 'Autumn'
return time
if N in range(12):
yeartme = check(winter_list, spring_list, summer_list, Autumn_list)
print(yeartme)
print('NO')
end = input('enter smth to close program') #Не обязательная строка. Просто не даёт закрыться консоли сразу после выполнения кода
1
x = int(input())
if(x >= 100 and x <= 999):
print("Число трехзначное")
else: print("Число НЕ трехзначное")
2
month = int(input())
if(month >= 1 and month <= 12):
if(month == 1 or month == 3 or month == 5 or month == 7 or month == 8
or month == 10 or month == 12):
print(31)
elif(month == 2):
print(28)
else: print(30)
else: print("Неверно введеный номер месяца!")
3
from sys import exit
month = int(input("Месяц: "))
day = int(input("День: "))
remainder = 0
if(month == 1 or month == 3 or month == 5 or
month == 7 or month == 8 or month == 10 or month == 12):
if(day >= 1 and day <= 31):
pass
else: print("Неверно введены дни месяца!"); exit();
if(day >= 1 and day <= 28):
if(day >= 1 and day <= 30):
print("Неверно введены дни месяца!"); exit();
for i in range(1, month+1):
if(i == 1 or i == 3 or i == 5 or i == 7 or i == 8
or i == 10 or i == 12):
remainder += 31
elif(i == 2):
remainder += 28
else: remainder += 30
remainder += day
print("До нового года осталось: " + str(365 - remainder))
4
if(month == 12 or month == 1 or month == 2):
print("Winter!")
elif(month == 3 or month == 4 or month == 5):
print("Spring!")
elif(month == 6 or month == 7 or month == 8):
print("Summer!")
elif(month == 9 or month == 10 or month == 11):
print("Autumn!")
else: print("Wrong number of month!")
winter_list = [1,2,12]
spring_list = [3,4,5]
summer_list = [6,7,8]
Autumn_list = [9,10,11]
N = int(input())
def check(winter_list, spring_list, summer_list, Autumn_list):
if N in winter_list:
time = 'winter'
elif N in spring_list:
time = 'spring'
elif N in summer_list:
time = 'Summer'
else:
time = 'Autumn'
return time
if N in range(12):
yeartme = check(winter_list, spring_list, summer_list, Autumn_list)
print(yeartme)
else:
print('NO')
end = input('enter smth to close program') #Не обязательная строка. Просто не даёт закрыться консоли сразу после выполнения кода
1
x = int(input())
if(x >= 100 and x <= 999):
print("Число трехзначное")
else: print("Число НЕ трехзначное")
2
month = int(input())
if(month >= 1 and month <= 12):
if(month == 1 or month == 3 or month == 5 or month == 7 or month == 8
or month == 10 or month == 12):
print(31)
elif(month == 2):
print(28)
else: print(30)
else: print("Неверно введеный номер месяца!")
3
from sys import exit
month = int(input("Месяц: "))
day = int(input("День: "))
remainder = 0
if(month >= 1 and month <= 12):
if(month == 1 or month == 3 or month == 5 or
month == 7 or month == 8 or month == 10 or month == 12):
if(day >= 1 and day <= 31):
pass
else: print("Неверно введены дни месяца!"); exit();
elif(month == 2):
if(day >= 1 and day <= 28):
pass
else: print("Неверно введены дни месяца!"); exit();
else:
if(day >= 1 and day <= 30):
pass
else:
print("Неверно введены дни месяца!"); exit();
for i in range(1, month+1):
if(i == 1 or i == 3 or i == 5 or i == 7 or i == 8
or i == 10 or i == 12):
remainder += 31
elif(i == 2):
remainder += 28
else: remainder += 30
remainder += day
print("До нового года осталось: " + str(365 - remainder))
else: print("Неверно введеный номер месяца!")
4
month = int(input())
if(month >= 1 and month <= 12):
if(month == 12 or month == 1 or month == 2):
print("Winter!")
elif(month == 3 or month == 4 or month == 5):
print("Spring!")
elif(month == 6 or month == 7 or month == 8):
print("Summer!")
elif(month == 9 or month == 10 or month == 11):
print("Autumn!")
else: print("Wrong number of month!")