MCQ Answer

<p>What will be the output of the following Python code if the system date is 18th August, 2016?</p> <pre><font color="#333333"><span style="font-size: 14px;">import datetime<br></span></font><font color="#333333"><span style="font-size: 14px;">d=datetime.date.today()<br></span></font><font color="#333333"><span style="font-size: 14px;">print(d.month)</span></font></pre>

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)


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

import datetime
d=datetime.date.today()
print(d.month)
Topic : Modules in Python

A. August अगस्त

B. Aug

C. 08

D. 8




Correct Answer is :

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.
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2025 Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz