Verilen bir tarihin yılın kaçıncı günü olduğunu bulan Python Örneği.

A

Aswenya

Ultra Member
Joined
Aug 1, 2019
Messages
585
Reaction score
120
Python:
def ArtıkYıl(yıl):
    artık=False
    if yıl%400==0 or (yıl%4==0 and yıl%100!=0): artık=True
    return artık
 
def YılınGünü(Ay,Gün,Yıl):
    günler=[31,28,31,30,31,30,31,31,30,31,30,31]
    if ArtıkYıl(Yıl):
        günler[1]=29
    sıra=0
    for a in range(Ay-1):
        sıra+=günler[a]
    sıra+=Gün
    return sıra
 
print(YılınGünü(4,9,2018))
 
SPAM IS FORBIDDEN!
  • SPAMMERS ARE BANNED FROM THE FORUM AND CANNOT USE ANY OF THE CHEATS
  • For example: thanks, thx, very good, asdqwe, working, ty and so on!
  • For example: Writing the same message over and over. thanks, thx and so on!
  • Copying and copying someone else's message is prohibited.
  • It is forbidden to send messages to increase the number of comments on threads that you have no knowledge of.
  • Write your own opinion when commenting!
  • If you see spam message, please let us know with the REPORT button!

Tema düzenleyici

Top Bottom