4D Utube
Python
How to make virus - Python
How to make virus 2 - Python
How to calculate birthday from NIC number | Python
Code ⬇
nic=(input("Enter your NIC No : "))
def BDcal(x):
#Gender
if x<500:
print('Gender : Male')
else:
print("Gender : Female")
x = x-500
#Month
if x<=31:
print("Month : January")
date = x
elif x<=60:
print("Month : February")
date = x-31
elif x<=91:
print("Month : March")
date = x-60
elif x<=121:
print("Month : April")
date = x-91
elif x<=152:
print("Month : May")
date = x-121
elif x<=182:
print("Month : June")
date = x-152
elif x<=213:
print("Month : July")
date = x-182
elif x<=244:
print("Month : August")
date = x-213
elif x<=274:
print("Month : September")
date = x-244
elif x<=305:
print("Month : October")
date = x-274
elif x<=335:
print("Month : November")
date = x-305
elif x<=366:
print("Month : December")
date = x-335
#Date
return (str(date))
#Old NIC No
if nic[9]=="v" or nic[9]=="x":
year="19" + nic[0]+nic[1]
print("Year : " +year)
Odays=int(nic[2]+nic[3]+nic[4])
print(BDcal(Odays))
#New NIC No
else:
print("Year : "+nic[0]+nic[1]+nic[2]+nic[3])
Ndays=int(nic[4]+nic[5]+nic[6])
print(BDcal(Ndays))
➡️
No comments:
Post a Comment
Home
Subscribe to:
Posts (Atom)
No comments:
Post a Comment