Skip to content

Commit

Permalink
Corrección de error en pedir_respuesta
Browse files Browse the repository at this point in the history
  • Loading branch information
dcsibon committed Oct 24, 2024
1 parent d13c742 commit b17363d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion PiramideSumas/piramideSumas1.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def pedir_respuesta(msj: str) -> str:
while not respuesta_correcta:
try:
respuesta = input(msj).replace(" ", "").upper()
if respuesta not in "SN":
if respuesta == "" or not respuesta in "SN":
raise ValueError("Respuesta incorrecta")
except ValueError as e:
print(f"*ERROR* {e}")
Expand Down
2 changes: 1 addition & 1 deletion PiramideSumas/piramideSumas2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def pedir_respuesta(msj: str) -> str:
while not respuesta_correcta:
try:
respuesta = input(msj).replace(" ", "").upper()
if respuesta not in "SN":
if respuesta == "" or not respuesta in "SN":
raise ValueError("Respuesta incorrecta")
except ValueError as e:
print(f"*ERROR* {e}")
Expand Down
2 changes: 1 addition & 1 deletion PiramideSumas/piramideSumas2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def pedir_respuesta(msj: str) -> str:
while not respuesta_correcta:
try:
respuesta = input(msj).replace(" ", "").upper()
if respuesta not in "SN":
if respuesta == "" or not respuesta in "SN":
raise ValueError("Respuesta incorrecta")
except ValueError as e:
print(f"*ERROR* {e}")
Expand Down
2 changes: 1 addition & 1 deletion PiramideSumas/piramideSumas3a.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def pedir_respuesta(msj: str) -> str:
while not respuesta_correcta:
try:
respuesta = input(msj).replace(" ", "").upper()
if respuesta not in "SN":
if respuesta == "" or not respuesta in "SN":
raise ValueError("Respuesta incorrecta")
except ValueError as e:
print(f"*ERROR* {e}")
Expand Down
2 changes: 1 addition & 1 deletion PiramideSumas/piramideSumas3b.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def pedir_respuesta(msj: str) -> str:
while not respuesta_correcta:
try:
respuesta = input(msj).replace(" ", "").upper()
if respuesta not in "SN":
if respuesta == "" or not respuesta in "SN":
raise ValueError("Respuesta incorrecta")
except ValueError as e:
print(f"*ERROR* {e}")
Expand Down

0 comments on commit b17363d

Please sign in to comment.