Python Programming Basics
Introduction to Python
Python is a high-level, interpreted, general-purpose programming language.
It is known for its easy syntax and readability.
Key Features:
- Simple and easy to learn
- Interpreted language
- Dynamically typed
- Large standard library
- Open-source and community-driven
Basic Syntax:
1. Printing:
print("Hello, World!")
2. Variables:
name = "Alice"
age = 25
3. Data Types:
- int, float, str, bool, list, tuple, dict, set
4. Conditional Statements:
Page 1
Python Programming Basics
if age > 18:
print("Adult")
5. Loops:
for i in range(5):
print(i)
while age < 30:
age += 1
6. Functions:
def greet(name):
return "Hello " + name
7. Lists:
fruits = ["apple", "banana", "cherry"]
8. Dictionaries:
student = {"name": "Bob", "age": 20}
This is a basic overview of Python programming to get started with writing simple scripts and
understanding the core concepts.
Page 2