Inicio
/
Tecnología
/
This Code Has 5 Syntax Errors! Find Them and Correct Them. When You Have Found and Corrected All Five, Run the Program and Verify That

Problemas

this code has 5 syntax errors! Find them and correct them. When you have found and corrected all five, run the program and verify that it works.You can change the initial score # to test different outcomes of the program. Create a variable called score, setting it to 10 score=10 If the score is zero or less 10-if scor <= 0: Output to the user that they lose print("You Lose!) : Output - You Min!- and the score to the user print("You Win!") prnit("Your score is: ") print (score) Mish the user good luck next time (If they win AND if they lose) print("Good luck next time.")

Roztwór

Ana Paula maestro · Tutor durante 5 años
Weryfikacja ekspertów
4.2 (117 Votos)

Respuesta

Here is the corrected code with the five syntax errors fixed:```python# Create a variable called score, setting it to 10score = 10# If the score is zero or lessif score <= 0: # Output to the user that they lose print("You Lose!") # Output - You Win! - and the score to the userprint("You Win!")print("Your score is:", score)# Wish the user good luck next time (If they win AND if they lose)print("Good luck next time.")```Explanation of the corrections made:1. Changed `: Create a variable called score, setting it to 10` to `# Create a variable called score, setting it to 10` to convert the comment to a Python comment.2. Changed ` ` to `score = 10` to use proper Python variable assignment.3. Changed `10-if scor <= 0:` to `if score <= 0:` to fix the indentation and use the correct variable name.4. Changed `print("You Min!")` to `print("You Win!")` to correct the typo.5. Changed `print (score)` to `print("Your score is:", score)` to provide the correct output format.6. Changed `prnit("Good luck next time.")` to `print("Good luck next time.")` to correct the typo.