So I'm trying to make a program where the user inputs notes and it timestamps them, but when I run this all the date-times are the same. Is there any way I can change this?
from time import time, ctime
t = time()
noteno = int(input("How many notes would you like to add? "))
for i in range (noteno):
note = input("Add note: ")
stamp1 = ctime(t)
print(f"Note stamped at: {stamp1}")
You can put the t=time() in for loop.
from time import time, ctime
noteno = int(input("How many notes would you like to add? "))
for i in range (noteno):
t = time()
note = input("Add note: ")
stamp1 = ctime(t)
print(f"Note stamped at: {stamp1}")