Skip to content
Open

Ex3 #197

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ex2.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,11 @@
#
# return 0;
# }

week = int(input("Enter week number(1-7): "))
days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]

if 1 <= week <= 7:
print(days[week - 1])
else:
print("Invalid input! Please enter week number between 1-7.")
17 changes: 17 additions & 0 deletions src/ex3.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,20 @@
#
# return 0;
# }

textInput = input("Enter a famous name+surname, ex. BarackObama: ")
match textInput:
case "BarackObama":
print("44th president of the United States")
case "SandroPertini":
print("Former President of the Italian Republic")
case "NelsonMandela":
print("Former President of South Africa")
case "MahatmaGandhi":
print("Bapu")
case "DonaldKnuth":
print("Creator of LaTeX")
case "DennisRitchie":
print("Creator of C")
case _:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hai caricato due file al posto di uno per l'esercizio 3

print("Invalid input! Please enter a good name!")