Report Bug

Qus

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.weekday())
Qus

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

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


A. 6
B. 1
C. 0
D. 7


Solution
A. 6



Explanation
The code shown above prints an integer depending on which day of the week it is. Monday-0, Tuesday-1, Wednesday-2, Thursday-3, Friday-4, Saturday-5, Sunday-6. Hence the output is 6 in the case shown above.
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