Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 34bdfc1

Browse files
Add Calendar generator
Generates and displays the calendar for a given year. Uses the built-in calendar module in python.
1 parent f83db40 commit 34bdfc1

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

‎Calendar.ipynb‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 3,
6+
"id": "f6959082-2f25-4949-b487-635253ea2219",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"name": "stdin",
11+
"output_type": "stream",
12+
"text": [
13+
"Enter the month: 12\n"
14+
]
15+
},
16+
{
17+
"name": "stdout",
18+
"output_type": "stream",
19+
"text": [
20+
"December\n"
21+
]
22+
}
23+
],
24+
"source": [
25+
"month = int(input(\"Enter the month:\"))\n",
26+
"match month:\n",
27+
" case 1:\n",
28+
" print(\"January\")\n",
29+
" case 2:\n",
30+
" print(\"February\")\n",
31+
" case 3:\n",
32+
" print(\"March\")\n",
33+
" case 4:\n",
34+
" print(\"April\")\n",
35+
" case 5:\n",
36+
" print(\"May\")\n",
37+
" case 6:\n",
38+
" print(\"June\")\n",
39+
" case 7:\n",
40+
" print(\"July\")\n",
41+
" case 8:\n",
42+
" print(\"August\")\n",
43+
" case 9:\n",
44+
" print(\"September\")\n",
45+
" case 10:\n",
46+
" print(\"October\")\n",
47+
" case 11:\n",
48+
" print(\"November\")\n",
49+
" case 12:\n",
50+
" print(\"December\")\n",
51+
" case _:\n",
52+
" print(\"Please enter valid number\")"
53+
]
54+
},
55+
{
56+
"cell_type": "code",
57+
"execution_count": null,
58+
"id": "292b545d-c449-45b9-96d1-d710f62aed7d",
59+
"metadata": {},
60+
"outputs": [],
61+
"source": []
62+
}
63+
],
64+
"metadata": {
65+
"kernelspec": {
66+
"display_name": "Python [conda env:base] *",
67+
"language": "python",
68+
"name": "conda-base-py"
69+
},
70+
"language_info": {
71+
"codemirror_mode": {
72+
"name": "ipython",
73+
"version": 3
74+
},
75+
"file_extension": ".py",
76+
"mimetype": "text/x-python",
77+
"name": "python",
78+
"nbconvert_exporter": "python",
79+
"pygments_lexer": "ipython3",
80+
"version": "3.12.7"
81+
}
82+
},
83+
"nbformat": 4,
84+
"nbformat_minor": 5
85+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /