NIELIT O Level Exam

<p>What will be the output of the following Python code if the system date is: 6/19/2017</p><pre><span style="font-size: 14px;">import datetime<br></span><span style="font-size: 14px;">tday=datetime.date.today()<br></span><span style="font-size: 14px;">tdelta=datetime.timedelta(days=10)&nbsp;<br></span><span style="font-size: 14px;">print(tday+tdelta)</span></pre><div><br></div>

What will be the output of the following Python code if the system date is: 6/19/2017

import datetime
tday=datetime.date.today()
tdelta=datetime.timedelta(days=10) 
print(tday+tdelta)


यदि सिस्टम का दिनांक है: 6/19/2017, तो निम्न पायथन कोड का आउटपुट क्या होगा

import datetime
tday=datetime.date.today()
tdelta=datetime.timedelta(days=10) 
print(tday+tdelta)

A. 2017-16-19

B. 2017-06-9

C. 2017-06-29

D. Error एरर




Correct Answer is :

C. 2017-06-29



Explanation
The code shown above will add the specified number of days to the current date and print the new date. On adding ten days to 6/19/2017, we get 6/29/2017. Hence the output is: 2017-06-29.
Latest Current Affairs 2025 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