I've tried several times to learn Python, but all have failed. I'm finally feeling bad if I don't really remember it, so I'll try hard to study.
So, if you publish the process, it might be useful for other people.
"[Perfect Python](https://www.amazon.co.jp/%E3%83%91%E3%83%BC%E3%83%95%E3%82%A7%E3%82%AF%E3" % 83% 88Python-PERFECT-5-Python% E3% 82% B5% E3% 83% 9D% E3% 83% BC% E3% 82% BF% E3% 83% BC% E3% 82% BA / dp / 477415539X ) ”Will be used as a reference.
Follow "Appendix A" to install Python on Windows. The download site is here.
According to the reference book, other libraries are often built with 32bit, so it is better to install the 32bit version, so
Windows x86 executable installer
I decided to download. You can download "python-3.6.0.exe", so run it to install it. It is better to check the "Add to path" check box. (By default, it will be installed very deeply)
From "Chapter 2", "Chapter 3", "Chapter 4", and "Chapter 5", there is a lot of discomfort, and the point that you have to remember this is a note as easy as possible. (The only thing you don't need to know is that it's confusing, so I'll skip it.)
--A dedicated window (hereinafter referred to as "Python window") opens when python.exe is executed. --"Quit ()" (or "Ctrl-Z") to close the Python window --Can also be executed with "python.exe file name" from a DOS window, etc. --If you want to execute the file, click here --The prompt is ">>>" --Basically specified in units of one line --If it is a function, it will be in continuous input mode. --If you insert a blank line, the continuous input mode will end. --Japanese is UNICODE (UTF-8) --In the Python window, if you want to know the variables and functions that have already been set, "locals ()"
In addition, I proceeded with studying in a two-window system consisting of a DOS window (for file execution) and a Python window (for input immediate execution).
--There is basically no such thing as "()" or "{}" --"()" Is used to specify the argument of the function ――It seems that you also use "{}", but you don't have to know it. --Block specification by indentation --Tab is good because indentation is hard to understand if it is a space ――But the recommendation is space --Do not add ";" at the end of the line --Comments start with "#", multi-line comments are enclosed in "'''" --No type declaration --There is no constant (define)
You should read PEP8 properly.
--Numerical variables are only "integers", "real numbers", and "complex numbers" --String type variables will be so if you insert a string --The array looks like a "list" (even different types can be inserted) --The empty declaration is "x = []" --It is difficult to understand that the insert is "list.insert (pos, value)" and the delete is "del list (pos)". --There seems to be a hand called "list.pop (pos)" --It seems that there is also a byte array --Map type (key-value type) exists under the name "dictionary type" --Actually, use "{}" with this guy --"Null" is "None"
--"Def" at the beginning of the function --":" After the function name ――Is this the meaning of "{" (though it doesn't close) --The return value is "return hoge" --It is also possible to return a function
--"Import" to load modules (like libraries) --The module that can be used in calculations is "math"
--If statements are "if True:" "el if True:" "else:" --The for statement is "for item in x:" (iteration) --The elements of x enter item in order --Can also be obtained with x [n] --Let's also remember range () --while statement is "while True:" "else:" --There is also exception handling
I haven't been able to do anything at this level yet, but I feel that the place I had given up until now has been exceeded.
Recommended Posts