+ 2
How to indexing if i have too many years in this code?
6 Antworten
+ 4
def print_hi(name):
print("Hi,", name)
print_hi("Nafi Rahat Rahman")
birth_year = int(input("Input birth year:"))
print("Age", 2022-birth_year)
+ 1
Why you need list?
2022 - input
will return age. Is not it?
+ 1
Nafi Rahat Rahman
import time
current_year = time.gmtime().tm_year
print(current_year)
0
Yeah
0
How to input date and time module to do this
0
You can do the following to get the current year:
import datetime
current_year = datetime.datetime.now().year