descrizione interessante#227
Closed
Kristoferz wants to merge 4 commits into
Closed
Conversation
TendTo
reviewed
Nov 11, 2025
Comment on lines
+54
to
+57
| while True: | ||
| week_input = int(input("inserire giorno: ")) | ||
| if week_input>=0 and week_input<=7: | ||
| break |
Collaborator
There was a problem hiding this comment.
Cosa succede se l'utente inserisce 7?
Author
There was a problem hiding this comment.
ah si, devo togliere l'uguale in "week_input<=7" sennò accedo a memoria all'esterno dell'array
Comment on lines
+31
to
+53
| 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 |
Collaborator
There was a problem hiding this comment.
Invece che usare una variabile ausiliaria potresti semplicemente concatenare degli elif e far ricadere la casistica non valida nell'else finale
Author
There was a problem hiding this comment.
si, in effetti non ci ho pensato
Contributor
|
in teoria per ogni esercizio sarebbe opportuno creare una PR diversa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.