0

How can I get a print statement governed by 'except: ' to print? I can't find what I'm doing wrong.

https://code.sololearn.com/cfHzjPhS4McT/?ref=app

24th Jul 2017, 5:35 PM
Anthony
Anthony - avatar
6 ответов
+ 2
or you put everything into the try block except the error printing.
24th Jul 2017, 6:03 PM
Jonas Schröter
Jonas Schröter - avatar
+ 1
To your second question, that's the playgrounds guilt. If you run it on desktop, it should work fine.
24th Jul 2017, 5:48 PM
Jonas Schröter
Jonas Schröter - avatar
+ 1
Yes, as @Jonas Schröter said, your code first tries to convert string into integer and raises an error. So you need to first input Number as a string, and then convert it to integer inside the try block
24th Jul 2017, 5:59 PM
Dinmukhamed Mailibay
Dinmukhamed Mailibay - avatar
0
The problem is that the Error is raised in ypur first line of code.
24th Jul 2017, 5:45 PM
Jonas Schröter
Jonas Schröter - avatar
0
Thanks guys. Your suggestions worked
24th Jul 2017, 6:09 PM
Anthony
Anthony - avatar
0
Glad I could help😊
24th Jul 2017, 6:09 PM
Jonas Schröter
Jonas Schröter - avatar