Skip to content

Instantly share code, notes, and snippets.

@ozgurkaracam
Created September 21, 2017 23:12
Show Gist options
  • Save ozgurkaracam/73e57d2b2eb4f30f9cb8c99101e0516f to your computer and use it in GitHub Desktop.
Save ozgurkaracam/73e57d2b2eb4f30f9cb8c99101e0516f to your computer and use it in GitHub Desktop.
29 Ekim 1923 Pazartesi gününe denk gelmektedir. Bu yıl ki (2017) Cumhuriyet bayramı da dahil olmak üzere acaba bugüne kadar kaç Cumhuriyet bayramını hafta sonu kutladık. Nisan, Haziran, Eylül ve Kasım ayları 30 gün gelmekte. Şubat ayı artık yıl olduğunda 29, diğer yıllarda 28 gün gelmekte. Diğer aylar 31 gün gelmekte. 4 ile bölünebilen aylar ar…
class republic():
def __init__(self,year,day):
self.year=year
self.day=day
i=1923
x=0
c=[]
while(i<=2017):
if(i%4==0):
x=x+366
else:
x=x+365
if(x%7 == 0 or x%7==6):
if(x%7==0):
day="pazar"
elif(x%7==6):
day="cumartesi"
rep=republic(i,day)
c.append(rep)
i=i+1
for republic in c:
print(republic.year," ",republic.day)
print("toplam ",len(c),"yıl")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment