gs gs109 Python Modules - Python Datetime Module - Quiz No.1
gs gs109 Python Quiz
This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Python Modules. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: What will be the output of the following Python code?
import datetime d=datetime.date(2016,7,24) print(d)
Error
2017-07-24
2017-7-24
24-7-2017
Question 2: What will be the output of the following Python code?
import datetime d=datetime.date(2017,06,18) print(d)
Error
2017-06-18
18-06-2017
06-18-2017
Question 7: Point out the error (if any) in the code shown below if the system date is 18th June, 2017?
tday=datetime.date.today() bday=datetime.date(2017,9,18) till_bday=bday-tday print(till_bday)
3 months, 0:00:00
90 days, 0:00:00
3 months 2 days, 0:00:00
92 days, 0:00:00
Question 9: Which of the following will throw an error if used after the following Python code?
tday=datetime.date.today() bday=datetime.date(2017,9,18) t_day=bday-tday
print(t_day.seconds)
print(t_day.months)
print(t_day.max)
print(t_day.resolution)