Answered step by step
Verified Expert Solution
Link Copied!

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 year/month/day,
#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: "5"+"1"="51".
from datetime import date
import datetime
todays_date = date.today()
current_time = datetime.datetime.now()
#Don't modify the code above!
#Complete the line below to print today's date with the
#form year/month/day. For example, January 15th,2016
#would be 2016/1/15.
print()
#Complete the line below to print the current time with
#the form hour:minute:second, such as 12:57:15. Don't worry
#about the leading 0s for single-digit times. If it's
#1:05PM and 7 seconds, the correct answer would be:
#13:5:7(13 because Python uses 24-hour timeby default).
print()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions