We’re going to start off this series by going through whatever fancies me on Real Python.
Their Introduction to Python seems like a reasonable place to start, so off we go.
We can start sharing and playing with code instantly with repl.it.
It turns out IDLE is an IDE for Python is perhaps usually installed with most distributions by default, so I figure I’d kick the tires on it. When I went to first open it on the command line it showed me this error:
Once I installed
tk-dev I was able to open it just fine:
Then re-install python so that it compiles with the
It then opens right up:
Data Types are a great place to start when building up an understanding of what primitive tools you have at your disposal in a language. They also usually come with a few odd traps or gotchas.
Otherwise, they work as expected, just like in most languages, round-off error exists because creating something like “1/10” in binary is nearly impossible without us all agreeing on how to represent it. The IEEE 754 specification is what Python (and most languages) have agreed upon.
Seeing as how Python is used by the scientific community, it is of no surprise that it has a way to represent imaginary numbers.
Work just like you expect, of course with the use of
\ allows you to break up strings which is nice, but
also lets you violate the requirements for whitespace in method definitions, so I imagine a more “Python” way might
be to use a String builder pattern, but who knows.
Raw Strings are pretty cool in that it will ignore all the escape characters if you prefix the string with an