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.
CCC Online Test 2021 CCC Practice Test Hindi 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