Python_Full_Roadmap_Notes_Detailed
Python_Full_Roadmap_Notes_Detailed
1. Introduction to Python
Python is an interpreted, high-level, dynamically typed programming language created by
Guido van Rossum. It emphasizes code readability and allows programmers to express
concepts in fewer lines of code. Python supports multiple programming paradigms,
including procedural, object-oriented, and functional programming. It is widely used in web
development, data science, artificial intelligence, scripting, and automation.
Code Example:
print("Welcome to Python!")
# This prints a greeting message to the console.
Code Example:
python --version
# This command checks the installed Python version.
Code Example:
name = "Alice"
age = 30
print("Name:", name)
print("Age:", age)
4. Data Types and Type Casting
Python has several built-in data types including integers (int), floating point numbers
(float), strings (str), booleans (bool), lists, tuples, sets, and dictionaries. Type casting can be
done using functions like int(), float(), str(), and bool().
Code Example:
x = 42
print(type(x))
y = str(x)
print(type(y))
5. Operators
Python supports various operators:
- Arithmetic: +, -, *, /, %, //, **
- Comparison: ==, !=, >, <, >=, <=
- Logical: and, or, not
- Bitwise: &, |, ^, ~, <<, >>
- Assignment: =, +=, -=, *=, /=, etc.
- Membership: in, not in
- Identity: is, is not
Code Example:
a = 10
b=3
print(a + b)
print(a > b)
print(a is not b)