month = 10
year = 2020
numDays = 31
from datetime import date
d = date(1958,10,1)
day_of_week = (d.weekday()+1)%7
print(day_of_week)
3
import sys
from datetime import date
s = '-1234'
n = 1234
m = int(s)
print(m)
str(n)
-1234
'1234'
def name_of_month(month):
mnames = ['January','February','March','April','May','June',
'July','August','September','October','November','December']
return mnames[month-1]
name_of_month(10)
'October'
list(range(1,30))
[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, 27, 28, 29]
print(1,end=' ')
print(2)
1 2
print('aaaaaaaaaa')
aaaaaaaaaa
day_of_week = 2
print('a'*day_of_week)
aa
list(range(1,10))
[1, 2, 3, 4, 5, 6, 7, 8, 9]
def leap_year(year):
return ((year%4 == 0) and not (year%100 == 0 and year%400 != 0))
leap_year(1)
False
def leap_year_wiki(year):
if (year%4 != 0):
return False
elif (year%100 != 0):
return True
elif (year%400 != 0):
return False
else:
return True
78%4
2
leap_year_wiki(1900)
False