I took Progete's Python Learning Course I

■ Program

Let's touch Python

  1. Check the target

Learn the basics of Python 2. String 3. Numerical value 4. Let's calculate

・ Let's output a character string (Example) print ('hello Python') (Point) Surround with single or double quotation marks   ・ Numerical value (Example) print (3) (Point) Do not enclose numbers in quotation

Let's use variables 5. Variables 6. Let's use variables 7. Let's update the value of the variable 8. String concatenation 9. Data type

·variable (Example) name ='soarer'     number = 48

・ How to name variables Good example (Example) date Use English words user_name Separate two or more words with an underscore

bad example (Example) 1name Start number namae use romaji Name Japanese

・ Concatenation of character strings (Example) print ('Hallo' +'Python')

-Update the value of the variable (Example) x = 48 print(x) x = 46 Overwrite variable value

・ Data type (Example)'Hello Python' string type 3 Numeric type

(Example) print (4 + 8) Numerical calculation result 12 print ('4' + '8') Character concatenation result 48

-Type conversion str (Example) price = 100 print ('The price of an apple is' + price +'Yen') print ('The price of an apple is' + str (price) +'Yen') ← Convert to string type with str

・ Type conversion int (Example) count = '48'     price = 100 total_price = price * int (count) ← Convert to numeric type

Boolean value and conditional branching 10. if statement 11. Boolean value 12. else 13. elif 14. Let's combine conditional expressions

・ Conditional expression of if statement (Example) x == y Holds when the left and right values are equal x! = y holds when the left and right values are not equal

-Indent (indent) when writing the processing when the conditional expression of the if statement is satisfied.

・ Authenticity value

score = 100 if score == 100: ← colon

score = 100 print(score == 100)

True False

print(3 == 3) True print(3 == 5) False

score = 100 if score == 100: True holds

score = 50 if score == 100: True does not hold

・ Else (Example) score = 50 if score == 100: ← colon print ('well done') ← indent else: ← colon print ('Let's do our best')

・ Elif (Example) score = 70 if score == 100: ← colon print ('well done') ← indent elif score> = 60: ← colon print ('decent') ← indent else: ← colon print ('Let's do our best') You can enter as many elifs as you like The end ends with else

Let's calculate the shopping price 15. Let's calculate the price 16. Receive input 17. Let's do conditional branching

Python I is recommended because it is easy to understand even for beginners.

Recommended Posts

I took Progete's Python Learning Course I
Notation I encountered while learning Python
python learning
Mayungo's Python Learning Episode 8: I tried input
[Python] Learning Note 1
Python learning notes
I started python
Python learning site
Python learning day 4
Python Deep Learning
Python learning (supplement)
Deep learning × Python
python learning notes
I started machine learning with Python Data preprocessing
What I learned about AI / machine learning using Python (1)
Python basic course (12 functions)
Python class (Python learning memo ⑦)
Python Basic Course (7 Dictionary)
"Object-oriented" learning with python
Python module (Python learning memo ④)
Python basic course (2 Python installation)
Reinforcement learning 1 Python installation
Python: Deep Learning Practices
Python ~ Grammar speed learning ~
Python: Unsupervised Learning: Basics
Python basic course (9 iterations)
I tried Python> autopep8
Python basic course (6 sets)
Python Basic Course (Introduction)
Private Python learning procedure
I implemented Python Logging
Learning Python with ChemTHEATER 02
I tried deep learning
Machine learning course memo
What I learned about AI / machine learning using Python (3)
Learning Python with ChemTHEATER 01
Relearn Python (Algorithm I)
Python basic course (13 classes)
[Python] I made a classifier for irises [Machine learning]
Mayungo's Python Learning Episode 1: I tried printing with print
Python: Deep Learning Tuning
Python + Unity Reinforcement Learning (Learning)
Python: Supervised Learning (Regression)
I tried Python> decorator
Why I chose Python
Python basic course (8 branches)
I compared Python more-itertools 2.5 → 2.6
What I learned about AI / machine learning using Python (2)
Python: Supervised Learning (Classification)
Python Basic Course (3 Python Execution)
I thought about a Python beginner's course on blockchain games
I started machine learning with Python Clustering & Dimension Compression & Visualization
What I learned about AI and machine learning using Python (4)
Mayungo's Python Learning Episode 3: I tried to print numbers with print
I tried fp-growth with python
I tried scraping with Python
Python exception handling (Python learning memo ⑥)
I wrote python in Japanese
curl -I python one liner
<Course> Deep Learning: Day2 CNN
Learning flow for Python beginners