Python Data Types
• Numeric Types: int, float, complex
• String Type: str
• Boolean Type: True, False
Assigning Variables
• Variables store data.
• Rules:
• - Cannot start with number
• - No spaces
• - Case sensitive
Python Keywords
• Reserved words you cannot use as variables.
• Examples: if, else, for, while, class, import
String Functions and Methods
• Common Methods:
• .upper(), .lower(), .title(), .strip(),
• .replace(), .split(), len()
Mathematical Operators
• + Addition
• - Subtraction
• * Multiplication
• / Division
• // Floor division
• % Modulus
• ** Exponent
Mathematical Functions
• From math module:
• sqrt(), pow(), ceil(), floor(), sin(), cos(), log(),
factorial()
Object-Oriented Programming
(OOP)
• Concepts:
• Class, Object, Encapsulation,
• Inheritance, Polymorphism
OOP Example
• class Student:
• def __init__(self, name, age):
• [Link] = name
• [Link] = age
• def display(self):
• print(name, age)