- Python is a popular programming language. It was created in 1991 by Guido van Rossum.
- web development (server-side),
- software development,
- mathematics,
- system scripting.
https://www.python.org/downloads/
https://code.visualstudio.com/download
https://marketplace.visualstudio.com/items?itemName=ms-python.python
$ python --version
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27","User")
mgs = "Hello World!"
print(mgs)
python HelloWorld.py
$ python
>> print("Hello, World!")
>> exit()
- Python uses indentation to indicate a block of code. Python will give you an error if you skip the indentation:
if 5 > 2:
print("Five is greater than two!")
if 5 > 2:
print("Five is greater than two!")
#This is a comment.
print("Hello, World!")
A variable can have a short name (like x and y) or a more descriptive name (age, carname, total_volume). Rules for Python variables:
- A variable name must start with a letter or the underscore character
- A variable name cannot start with a number
- A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
- Variable names are case-sensitive (age, Age and AGE are three different variables)
- Arithmetic operators
- Assignment operators
- Comparison operators
- Logical operators
- Identity operators
- Membership operators
- Bitwise operators
There are four collection data types in the Python programming language:
- List is a collection which is ordered and changeable. Allows duplicate members.
- Tuple is a collection which is ordered and unchangeable. Allows duplicate members.
- Set is a collection which is unordered and unindexed. No duplicate members.
- Dictionary is a collection which is unordered, changeable and indexed. No duplicate members.
(⇧ ⌥ F)
A debug toolbar appears along the top with the following commands from left to right: continue (F5), step over (F10), step into (F11), step out (⇧F11), restart (⇧⌘F5), and stop (⇧F5).
- Linting - Enable, configure, and apply a variety of Python linters.
- Debugging - Learn to debug Python both locally and remotely.
- Unit testing - Configure unit test environments and discover, run, and debug tests.
- Settings reference - Explore the full range of Python-related settings in VS Code.