Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pesel = input("Podaj Pesel: ")
- if len(pesel) != 11:
- print("BLAD")
- else:
- suma = (int(pesel[0])*9
- +int(pesel[1])*7
- + int(pesel[2])*3
- + int(pesel[3])*1
- + int(pesel[4])*9
- + int(pesel[5])*7
- + int(pesel[6])*3
- + int(pesel[7])*1
- + int(pesel[8])*9
- + int(pesel[9])*7)
- r = int(pesel[0:2])
- m = int(pesel[2:4])
- d = int(pesel[4:6])
- print("miesiac przed:", m)
- if int(pesel[-1]) == suma%10:
- if int(pesel[9])%2==0:
- plec = "K"
- else:
- plec = "M"
- # print ("{}-{}-22{} {}" .format(pesel[4:6],int(pesel[2:4])-60,r,plec))
- #69 90 21 37678 - 21 / 10 / 1869 - 150 lat - 69902137678 , 96120365873 - nie dziala, , 07311187358
- # 01511315872 - 2101
- if m <= 12:
- r = 1900 + r
- elif m <= 32 and m >= 20:
- r = 2000 + r
- m = m - 20
- elif m <= 92 and m >= 80:
- r = 1800 + r
- m = m - 80
- elif m <= 72 and m >= 60:
- r = 2200 + r
- m = m - 60
- elif m <= 52 and m >= 40:
- r = 2100 + r
- m = m - 40
- print(f"{d:02d}-{m:02d}-{r} {plec}")
- print("Miesiac po: ", m)
- else:
- print('BLAD')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement