What I learned in Python

Learn python with progate

Learning course I

The output is print ()

"" For character strings in (), no quotation marks for numbers The variable is variable name = "variable value" ex) name = "Shimajiro"

** Rules for naming ** Do not use numbers as initials Add _ for 2 or more words Attach with English words

** Benefits of using variables * Clarify what the contents of the data represent The same data can be used repeatedly You only need to change the value in one place

To add a number to an existing variable and assign it Variable name = variable name + numerical value Can be omitted with the operator = You can also concatenate characters with +

** Data type ** There are various types of data types ex) String type, numeric type Behaves differently with different data types Converting a data type is called ** type conversion ** Use ** "str" ** to convert a numeric type to a string type On the contrary, if you want to convert the string type to the numeric type, use ** "int" **.

** Conditional branch ** Divide the process according to whether a certain condition is met ** if statement ** Specify a conditional expression after if, and write the process to be executed when the condition is satisfied on the next line. if conditional expression: print ("processing")

In conditional expressions, the symbol ** "comparison operator" ** is often used to compare two values. == Equal! = Not equal if conditional expression **: ** ** In Python, the appearance (indentation) of the code directly affects the operation of the program *

** Boolean type ** "True and false type" includes "True" and "False" "True" when the conditional expression part using the comparison operator holds, "False" when it does not hold Symbols that compare the magnitude of values <,>, <=,> =

Processing when the condition is not met Use ** else ** When you want to define multiple cases where the condition is not met elif You can write as many elifs as you like, but it is judged from the top whether the conditions are met, and only the part that meets the conditions is processed first.

** Combine multiple conditional expressions ** and and or or not denial

Learning course II

list Manage multiple data together Create a list like [Element 1, Element 2] The value in the list is called ** element ** Can be assigned to a variable The numbers "0, 1, 2, ..." are assigned to the elements of the list in order from the front. This is called the index number Each element of the list can be obtained by using the list [index number].

Recommended Posts

What I learned in Python
I learned about processes in Python
Refactoring Learned in Python (Basic)
Python classes learned in chemoinformatics
I understand Python in Japanese!
I learned Python basic grammar
Character code learned in Python
Python functions learned in chemoinformatics
What I learned about AI / machine learning using Python (1)
What I do when imitating embedded go in python
What I learned about AI / machine learning using Python (3)
What I learned by participating in the ISUCON10 qualifying
What I learned about AI / machine learning using Python (2)
I wrote Fizz Buzz in Python
I can't install scikit-learn in Python
Elementary ITK usage learned in Python
I wrote the queue in Python
I tried Line notification in Python
I wrote the stack in Python
What I got stuck around GUI in WSL python environment
What I learned by solving 30 questions of python Project Euler
What beginners learned from the basics of variables in python
I put Python 2.7 in Sakura VPS 1GB.
Quadtree in Python --2
Basic Linear Algebra Learned in Python (Part 1)
Python in optimization
CURL in python
I tried to implement PLSA in Python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
SendKeys in Python
I tried to implement permutation in Python
Meta-analysis in Python
I made a payroll program in Python!
Unittest in python
I started python
I tried to implement PLSA in Python 2
Epoch in Python
Sudoku in Python
I tried using Bayesian Optimization in Python
DCI in Python
quicksort in python
nCr in python
I can't debug python scripts in Eclipse
N-Gram in Python
Programming in python
What is "mahjong" in the Python library? ??
Plink in Python
What I got from Python Boot Camp
Constant in python
I wanted to solve ABC159 in Python
What is python
I tried to implement PPO in Python
What I did with a Python array
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
StepAIC in Python
What I learned at hackerrank on 1/30 days.
N-gram in python