That "never" is a big word and should be used with caution. Especially for people striving for perfection.Your point is?
I do not know your application of the code. You can change the data type according to your requirement. For example float, double etc. instead of int.Why should the width of a nut be required to be an integer?
Look at the diagram. That formula does NOT yield the radius, but the diameter.When doing a 3D print you need to know the radius of the Polygon. This program (in theory) calculates that radius. I will need to go over the math again in the diagram because I do think I got something wrong. I know what the answer is empirically and the calculated value is nowhere close to that.
The answer to what? You aren't giving us enough information to know what the answer should or shouldn't be.I knew that, but it still doesn't work either way. The answer should be approximately 0.118 radius as done on a 3D printer.
Hi,The weird part is I wrote the code using notepad then changed the ext to .PY after saving it. Clunky but I am learning. Hey, it was my first real program in Python. Now on to loops.
I think there is a misunderstanding of what an IDE or code editor is vs what a Python interpreter does. Python 3.12 is Python 3.12 no matter if you are wrong it in notepad and running from the console (dos window/CMD window) or clicking run from the IDE tool bar.I'll stick with stock Python (if there is such a thing) for the moment.
Yes and using a full-featured IDE like PyCharm will greatly help with the beginner's mistakes (as opposed to notepad). Stuff like "sin60" vs "Sin60" would have been autocorrected.I think there is a misunderstanding of what an IDE or code editor is vs what a Python interpreter does. Python 3.12 is Python 3.12 no matter if you are wrong it in notepad and running from the console (dos window/CMD window) or clicking run from the IDE tool bar.
Writing it in a text editor, like Notepad (you might want to look into Notepad++) is fine. You give up some of the features that a Python-aware IDE offers, such as syntax highlighting, context-sensitive help, code completion, etc. But there's nothing intrinsically wrong with that approach. You also don't have to use a .txt extension and then change it later to .py. When you save it, just explicitly add the extension you want. If you choose to keep going this way, you can also associate the .py extension with Notepad (or whatever editor you end up using).What I was doing until I found idle in the Python folder what is writing it using notepad then changing the extension to .py, kludgy but it worked.
by Jake Hertz
by Dale Wilson
by Robert Keim
by Aaron Carman