Create a calendar output program without using the Python calendar function

Asked 2 years ago, Updated 2 years ago, 84 views

I received a task to write a calendar output program, but without using the calendar function, Can I write a program to print out a calendar by typing in the day of the week and how many days the month is?

I get two integers (Enter the last date, day of the week (Sunday to Saturday/ 0 to 6)

However, for numbers other than 0 to 6, the last date is not input and no content is output.

calendar python

2022-09-22 18:28

1 Answers

It's a strange question whether you can write a program or not. The right question is whether there is a consistent, systematic and efficient way to solve the problem. But that's the only way to draw a calendar. [strong] So let's first study whether there is a way to draw a calendar under a given condition.

If someone throws Andrew a piece of paper and a pen and asks him to do something like that, how can he draw a calendar?

If you tell the computer how to do this, and then you run it, that's the program. Think for yourself and try.


2022-09-22 18:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.