Report Bug

Qus

What will be the output of the following Python code if the system date is 18th August, 2016?

import datetime
d=datetime.date.today()
print(d.month)
Qus

यदि 18 अगस्त, 2016 को सिस्टम डेट निम्नलिखित Python कोड का आउटपुट क्या होगा?

import datetime
d=datetime.date.today()
print(d.month)


A. August
B. Aug
C. 08
D. 8


Solution
D. 8



Explanation
The code shown above prints the month number from the system date. Therefor the output will be 8 if the system date is 18th August, 2016.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad