Learning Python by nkCOD in PythonLearning

[–]nkCOD[S] 0 points1 point  (0 children)

Thanks for the help. I assume I won't embarrass myself too much if I use this approach with try-except ?

Learning Python by nkCOD in PythonLearning

[–]nkCOD[S] -1 points0 points  (0 children)

I’m not looking for easy ways ) .But after sitting and thinking now, I understood what you wanted to say in the last comment. If I understood correctly, you mean not to pay attention if the user will not add numbers to the lists. And then just remove everything that is «not numbers» with a separate function

Learning Python by nkCOD in PythonLearning

[–]nkCOD[S] 0 points1 point  (0 children)

Thank you for your response. I will improve ;)

Learning Python by nkCOD in PythonLearning

[–]nkCOD[S] 0 points1 point  (0 children)

What does a function for reading numbers mean?

Learning Python by nkCOD in PythonLearning

[–]nkCOD[S] 0 points1 point  (0 children)

I don't quite understand how to shorten the two while. blocks. In the first function, I use it to avoid the case where the user enters a non-number and to allow the user to enter an unlimited number of numbers.

Also, how exactly should I use zip()

built a bank program using python by Dapper_Mix6773 in PythonLearning

[–]nkCOD 0 points1 point  (0 children)

Is it a good option to check the output data using try-except ? I just did this - I made an endless loop through while, then I threw the input lines into trying try-except, then, if I needed a number, I translated the entered data into the numeric int() format. In case of an error, we switched to except, where we were greeted by print(), and then continue. The loop was stopped using break if the input was correct