0% found this document useful (0 votes)
3 views2 pages

Python

Uploaded by

programmingwong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Python

Uploaded by

programmingwong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Python Tutorial
Introduction

Python is a high-level, interpreted programming language known for its simplicity and
readability.

Installation

1. Windows/macOS: Download and install Python from python.org.


1. Linux:
sh
Copy code
sudo apt-get update
2. sudo apt-get install python3
2.

Basic Usage

Create a file hello.py:

python

Copy code

3. print("Hello, Python!")

Run the script:

sh

Copy code

4. python3 hello.py

Key Concepts

5. Variables:
python
Copy code
x = 5
6. y = "Hello"

● Data Types: int, float, str, list, tuple, dict, etc.
7. Control Structures:
python
Copy code
if x > 3:
8. print("x is greater than 3")
9. for i in range(5):
10. print(i)

11. Functions:
python
Copy code
def greet(name):
12. return f"Hello, {name}"
13.
● print(greet("World"))
14.

You might also like