Lab Description: I was assigned to complete “Date and time” from codeacademy. It had requested that I write a code that involves date and time.
Code:
from datetime import datetime now = datetime.now() m = str(now.month) d = str(now.day) y = str(now.year) print m + "/" + d + "/" + y + " " hh = str(now.hour) mm = str(now.minute) ss = str(now.second) print hh + ":" + mm + ":" + ss
Screenshots: