validation write and date time
from datetime import datetime def insertintofile (name , age , address): date = datetime.now() file= open ( "file.txt" , "w" ) file.write( "name:" + name + " \n " ) file.write( "age:" + age + " \n " ) file.write( "address:" + address + " \n " ) file.write( "date and time :" + str (date) + " \n " ) file.close def view (): file= open ( "file.txt" , "r" ) print (file.read()) file.close() valid_characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ " while True : name = input ( "enter your name " ) if all (char in valid_characters for char in name): print ( "your name is:" + name) break print ( "That's invalid, please try again. Please enter characters A-Z and space only" ) valid_characters = "1234567890" while True : age = input ( &