Feb-20-2018, 08:19 PM
As I see it, 3 ways come to mind to collect "y", depending on what type of number you expect (i.e.: integer, float, complex or any of the 3). You then need to test if the user entered a number or a non-number.
Once you resolve the issue of "string" vs. "numeric", and you say you have no limitations, be sure and read Python's built in math library.
A final (very stern) request, break yourself of the habit of using single letter variables. Python strongly encourages descriptive names, whether it be variables, functions, classes, etc.
Once you resolve the issue of "string" vs. "numeric", and you say you have no limitations, be sure and read Python's built in math library.
A final (very stern) request, break yourself of the habit of using single letter variables. Python strongly encourages descriptive names, whether it be variables, functions, classes, etc.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition