Introduction to Python
• Python is a high-level, interpreted
programming language known for its
simplicity and readability.
Features of Python
• - Easy to learn and use
• - Interpreted language
• - Dynamically typed
• - Large standard library
• - Community support
• - Portable and open-source
Applications of Python
• - Web development
• - Data science
• - Machine learning
• - Automation
• - Game development
• - Desktop applications
Input and Output Statements
• Input: `input()` function is used to take input
from the user.
• Example: `name = input('Enter your name: ')`
• Output: `print()` function is used to display
output.
• Example: `print('Hello,', name)`
Identifiers
• Identifiers are the names used to identify
variables, functions, classes, etc.
• Rules:
• - Must begin with a letter (A-Z/a-z) or
underscore (_)
• - Cannot start with a digit
• - Case sensitive
Variables
• Variables are containers for storing data
values.
• Example:
• `x = 10`
• `name = 'John'`
Keywords
• Keywords are reserved words that cannot be
used as identifiers.
• Examples: `if`, `else`, `while`, `for`, `True`,
`False`, `None`, `def`, `class`
Constants
• Constants are values that do not change
during program execution.
• Python doesn't have built-in constant types,
but you can use naming conventions.
• Example: `PI = 3.14`
Data Types
• - Numeric: `int`, `float`, `complex`
• - Sequence: `str`, `list`, `tuple`
• - Boolean: `bool`
• - Set: `set`
• - Dictionary: `dict`
Operators
• - Arithmetic: `+`, `-`, `*`, `/`, `//`, `%`, `**`
• - Comparison: `==`, `!=`, `>`, `<`, `>=`, `<=`
• - Logical: `and`, `or`, `not`
• - Assignment: `=`, `+=`, `-=`, etc.
• - Bitwise: `&`, `|`, `^`, `~`, `<<`, `>>`