Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#Complete the code below. We've gone ahead and created #variables for the current date and current time. Now, #we want to print date with the
#Complete the code below. We've gone ahead and created
#variables for the current date and current time. Now,
#we want to print date with the format yearmonthday
#and the time with the format hour:minute:second.
#
#This is a tough one! Think about what we've learned
#about converting and putting together strings.
#Remember, we can add two strings together. For
#example:
from datetime import date
import datetime
todaysdate date.today
currenttime datetime.datetime.now
#Don't modify the code above!
#Complete the line below to print today's date with the
#form yearmonthday For example, January th
#would be
print
#Complete the line below to print the current time with
#the form hour:minute:second, such as :: Don't worry
#about the leading s for singledigit times. If it's
#:PM and seconds, the correct answer would be:
#:: because Python uses hour timeby default
print
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started