
Introduction to Python - Lesson 1
The reason why I learn Python is to prepare for Machine Learning.
Quick Start
Download Python
Download here if you haven’t yet.
Check if you have already downloaded Python
|
|
If the terminal displays as below, you have already downloaded it; Otherwise you haven’t.
|
|
Run a Python File
Create a folder
|
|
Make a file
|
|
Edit hello.py
|
|
Enter “i” and input the following
|
|
Press esc, then input “:x” to exit
Input
|
|
The result is
|
|
The above example shows how to make a basic python file, then we will see how to use the existing functions within Python, rewrite hello.py as following
|
|
Press esc, then input “:x” to exit
Input
|
|
The result is
|
|
The above example shows how to make inputs through command line, then we will see how to use if/else function, rewrite hello.py as following
|
|
Press esc, then input “:x” to exit
Input
|
|
The result is
|
|
Run Python Command
|
|
The usage of ‘’ and “”
|
|
Press cmd+d to exit
|
|
Long press q to exit
This is the first day I learned Python, keep going!
Reference here




近期评论