Report Bug

Qus

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)
Qus

यदि सिस्टम का दिनांक है: 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


Solution
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