Report Bug

Qus

Which of the following will throw an error if used after the following Python code?

tday=datetime.date.today()

  bday=datetime.date(2017,9,18) 

t_day=bday-tday

Qusयदि निम्नलिखित पायथन कोड के बाद यूज़ किया जाता है, तो निम्न में से कौन एक एरर हटाएगा ?


A. print(t_day.seconds)
B. print(t_day.months)
C. print(t_day.max)
D. print(t_day.resolution)


Solution
B. print(t_day.months)



Explanation
The statement: print(t_day.months) will throw an error because there is no function such as t_day.months, whereas t_day.seconds, t_day.max and t_day.resolution are valid, provided that t_day is defined.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad