def get_year(date):
if date[2] == "9":
year = date[:4]
else:
year = date[-4:]
return year
print(get_year('19950320'))
print(get_year('13121991'))
Jeśli masz jakieś pytania to pisz
Pozdrawiam :)
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
def get_year(date):
if date[2] == "9":
year = date[:4]
else:
year = date[-4:]
return year
print(get_year('19950320'))
print(get_year('13121991'))
Jeśli masz jakieś pytania to pisz
Pozdrawiam :)