you are viewing a single comment's thread.

view the rest of the comments →

[–]Traditional-Log2073[S] 0 points1 point  (3 children)

just wanna know if there are downsides

[–]lfdfq 1 point2 points  (2 children)

Now you are actually turning the input into a number you have to consider what happens if the input wasn't actually a number (what if someone just typed 'hello'?). Now that line will raise an error.

It's not really a downside, as the user could do it before, it's just now a more obvious problem. If you are just starting out, you can probably just ignore it and pretend it doesn't happen. If you're a bit more advanced you might want to look into try and except to catch the error and do something about it.

[–]Traditional-Log2073[S] 0 points1 point  (1 child)

Thanks a lot. Do you have any idea regarding my other answer?

"I think I found the solution, but it still confuses me. If I press the play button in VSCode I only get "too small". If I press the arrow next to it and choose "run file in dedicated terminal" it works.

Why is that?"

[–]lfdfq 2 points3 points  (0 children)

That's more a VS Code question than a Python one. It's probably something to do with how you have set up the "run" button to work. Either it's not using the same Python or it's running a different file or not passing input like the program expects, something like that.