From 28f3e919808047b8e6572b954dd88840fdf31bdf Mon Sep 17 00:00:00 2001 From: Kristoferz Date: Tue, 11 Nov 2025 18:02:23 +0100 Subject: [PATCH 1/3] descrizione interessante --- src/ex1.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ex1.py b/src/ex1.py index ae061ae7..b9846287 100644 --- a/src/ex1.py +++ b/src/ex1.py @@ -13,3 +13,4 @@ # # return 0; # } +week = input("Enter week number: ") From e35c7fde3b9f779a13f60b7afd3adf4b1b01e8a6 Mon Sep 17 00:00:00 2001 From: Kristoferz Date: Tue, 11 Nov 2025 18:32:29 +0100 Subject: [PATCH 2/3] secondo esercizio --- src/ex2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ex2.py b/src/ex2.py index 2ce418ef..5cfa6596 100644 --- a/src/ex2.py +++ b/src/ex2.py @@ -49,3 +49,10 @@ # # return 0; # } + +week = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] +while True: + week_input = int(input("inserire giorno: ")) + if week_input>=0 and week_input<=7: + break +print("hai selezionato: ", week[week_input]) \ No newline at end of file From 479c08f4b990fef949a3d33b1dde6a4c74d3f382 Mon Sep 17 00:00:00 2001 From: Kristoferz Date: Tue, 11 Nov 2025 18:45:34 +0100 Subject: [PATCH 3/3] es3 --- src/ex3.py | 68 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/src/ex3.py b/src/ex3.py index 74592df6..367119b3 100644 --- a/src/ex3.py +++ b/src/ex3.py @@ -7,37 +7,47 @@ # { # string textInput; # -# cout << "Enter a famous name+surname, ex. BarackObama " << endl; +# cout << "Enter a famous name+surname, ex. BarackObama ") # cin >> textInput; # # if (textInput == "BarackObama") -# { -# cout << "44th president of the United States" << endl; -# } -# else if (textInput == "SandroPertini") -# { -# cout << "Former President of the Italian Republic" << endl; -# } -# else if (textInput == "NelsonMandela") -# { -# cout << "Former President of South Africa" << endl; -# } -# else if (textInput == "MahatmaGandhi") -# { -# cout << "Bapu" << endl; -# } -# else if (textInput == "DonaldKnuth") -# { -# cout << "Creator of LaTeX" << endl; -# } -# else if (textInput == "DennisRitchie") -# { -# cout << "Creator of C" << endl; -# } -# else -# { -# cout << "Invalid input! Please enter a good name!" << endl; -# } -# +# # print(44th president of the United States") +# # if (textInput == "SandroPertini") +# # print(Former President of the Italian Republic") +# # if (textInput == "NelsonMandela") +# # print(Former President of South Africa") +# # if (textInput == "MahatmaGandhi") +# # print(Bapu") +# # if (textInput == "DonaldKnuth") +# # print(Creator of LaTeX") +# # if (textInput == "DennisRitchie") +# # print(Creator of C") +# # else +# # print(Invalid input! Please enter a good name!") +# # # return 0; # } + +good = False +textInput = input("Enter a famous name+surname, ex. BarackObama ") +if textInput == "BarackObama": + print("44th president of the United States") + good = True +if textInput == "SandroPertini": + print("Former President of the Italian Republic") + good = True +if textInput == "NelsonMandela": + print("Former President of South Africa") + good = True +if textInput == "MahatmaGandhi": + print("Bapu") + good = True +if textInput == "DonaldKnuth": + print("Creator of LaTeX") + good = True +if textInput == "DennisRitchie": + print("Creator of C") + good = True + +if good == False: + print("Invalid input! Please enter a good name!") \ No newline at end of file