✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
En el siguiente programa estamos leyendo números, introducidos por un usuario, repetidamente para calcular y mostrar sus potencias.
Complete el código para tratar la excepción ValueError:
while True: : x = int(input('next number: ')) print(x**2) ValueError: print('Good bye!') break
Ejemplo con diferentes entradas en que la excepción ValueError se lanza cuando una entrada —para la que se ha tecleado «end»— no puede ser convertida a int:
x: 11x: 24x: 10100x: endGood bye!
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!