No products in the cart.

Write a python program that display …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

Write a python program that display day on the given day number
  • 1 answers

Khushbu Garg 5 years, 6 months ago

<code>##</code>

<code># Python's program to get the day of week of today or given date.</code>

 

<code>import</code> <code>datetime</code>

 

<code>dayofweek </code><code>=</code> <code>datetime.date(</code><code>2010</code><code>, </code><code>6</code><code>, </code><code>16</code><code>).strftime(</code><code>"%A"</code><code>)</code>

<code>print</code><code>(dayofweek)</code>

<code># weekday Monday is 0 and Sunday is 6</code>

<code>print</code><code>(</code><code>"weekday():"</code><code>, datetime.date(</code><code>2010</code><code>, </code><code>6</code><code>, </code><code>16</code><code>).weekday())</code>

 

<code># isoweekday() Monday is 1 and Sunday is 7</code>

<code>print</code><code>(</code><code>"isoweekday()"</code><code>, datetime.date(</code><code>2010</code><code>, </code><code>6</code><code>, </code><code>16</code><code>).isoweekday())</code>

 

<code>dayofweek </code><code>=</code> <code>datetime.datetime.today().strftime(</code><code>"%A"</code><code>)</code>

<code>print</code><code>(dayofweek)</code>

<code>print</code><code>(</code><code>"weekday():"</code><code>, datetime.datetime.today().weekday())</code>

<code>print</code><code>(</code><code>"isoweekday()"</code><code>, datetime.datetime.today().isoweekday())</code>

http://mycbseguide.com/examin8/

Related Questions

What is mean by buffering in file handling?
  • 1 answers
What are called tokens
  • 2 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App