From a191a042558f9b3fd7dfcd6bb7b9afd87012f63d Mon Sep 17 00:00:00 2001 From: MatteoP Date: Mon, 30 Oct 2023 18:41:45 +0100 Subject: [PATCH 1/2] feat: ex1 calendar --- src/ex1.py | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/ex1.py diff --git a/src/ex1.py b/src/ex1.py new file mode 100644 index 0000000..5f4ff67 --- /dev/null +++ b/src/ex1.py @@ -0,0 +1,73 @@ +''' +/* convert in python this code */ + +#include +using namespace std; + +int main() +{ + int week; + + /* Input week number from user */ + cout << "Enter week number(1-7): " << endl; + cin >> week; + + if (week == 1) + { + cout << "Monday" << endl; + } + else if (week == 2) + { + cout << "Tuesday" << endl; + } + else if (week == 3) + { + cout << "Wednesday" << endl; + } + else if (week == 4) + { + cout << "Thursday" << endl; + } + else if (week == 5) + { + cout << "Friday" << endl; + } + else if (week == 6) + { + cout << "Saturday" << endl; + } + else if (week == 7) + { + cout << "Sunday" << endl; + } + else + { + cout << "Invalid input! Please enter week number between 1-7." << endl; + } + + return 0; +} +''' + +x=input('Enter day of the week number(1-7): ') +day_of_week= int(x) + +print('\n') + +match day_of_week: + case 1: + print('its MONDAY\n') + case 2: + print('its TUESDAY') + case 3: + print('its WEDNESDAY') + case 4: + print('its THURSDAY') + case 5: + print('its FRIDAY') + case 6: + print('its SATURDAY') + case 7: + print('its SUNDAY') + case _: + print("Invalid input! Please enter week number between 1-7.\n") \ No newline at end of file From 96cf1667137890774d8951451edee6b1d568e235 Mon Sep 17 00:00:00 2001 From: MatteoP Date: Mon, 30 Oct 2023 18:58:09 +0100 Subject: [PATCH 2/2] fix: indentation --- src/__init__.py | 0 src/ex1.py | 17 +++++++++-------- src/sum.py | 2 -- 3 files changed, 9 insertions(+), 10 deletions(-) delete mode 100644 src/__init__.py delete mode 100644 src/sum.py diff --git a/src/__init__.py b/src/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/ex1.py b/src/ex1.py index 5f4ff67..f14577c 100644 --- a/src/ex1.py +++ b/src/ex1.py @@ -56,18 +56,19 @@ match day_of_week: case 1: - print('its MONDAY\n') + print('its MONDAY\n') case 2: - print('its TUESDAY') + print('its TUESDAY') case 3: - print('its WEDNESDAY') + print('its WEDNESDAY') case 4: - print('its THURSDAY') + print('its THURSDAY') case 5: - print('its FRIDAY') + print('its FRIDAY') case 6: - print('its SATURDAY') + print('its SATURDAY') case 7: - print('its SUNDAY') + print('its SUNDAY') case _: - print("Invalid input! Please enter week number between 1-7.\n") \ No newline at end of file + print("Invalid input! Please enter week number between 1-7.\n") + \ No newline at end of file diff --git a/src/sum.py b/src/sum.py deleted file mode 100644 index 5dda91d..0000000 --- a/src/sum.py +++ /dev/null @@ -1,2 +0,0 @@ -def sum(a: int, b: int) -> int: - return a + b