NIELIT O Level Exam

<p>What will be the output of the following Python code if the system date is 18th June, 2017 (Sunday)?</p><pre><span style="font-size: 14px;">import datetime<br></span><span style="font-size: 14px;">tday=datetime.date.today()&nbsp;<br></span><span style="font-size: 14px;">print(tday)</span></pre><div><br></div>

What will be the output of the following Python code if the system date is 18th June, 2017 (Sunday)?

import datetime
tday=datetime.date.today() 
print(tday)


18 जून, 2017 (रविवार) को सिस्टम की तारीख के बाद निम्न पायथन कोड का आउटपुट क्या होगा?

import datetime
tday=datetime.date.today() 
print(tday)

A. 18-06-2017

B. 06-18-2017

C. 2017-06-18

D. Error एरर




Correct Answer is :

C. 2017-06-18



Explanation
The code shown above prints the system date in the format yyyy-mm-dd. Hence the output of this code is: 2017-06-18.
Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad