Python Programming - Unit 1
Introduction to Python
Introduction to Python
• Python is a general-purpose, high-level
programming language.
• It supports multiple programming paradigms
like OOP, procedural, and functional
programming.
History of Python
• • Developed by Guido van Rossum in late
1980s.
• • First released in February 1991.
• • Named after Monty Python's Flying Circus.
Why Python?
• • Easy to learn and use.
• • Versatile for different applications.
• • Dynamic typing and interpreted nature.
Applications of Python
• • Web Development (Django, Flask)
• • Data Science & AI
• • Game Development
• • IoT and Automation
Writing & Executing Python
Programs
• 1. Open IDLE.
• 2. Create a new file.
• 3. Write Python script.
• 4. Save with .py extension.
• 5. Run using F5.
Identifiers & Reserved Words
• • Identifiers are names given to variables,
functions, classes, etc.
• • Must start with a letter or underscore (_),
but not a digit.
• • Python has 35 reserved words.
Python Indentation
• • Uses indentation instead of braces {}.
• • Typically, 4 spaces per indentation level.
• • Essential for defining blocks of code.
Data Types in Python
• • Numeric: int, float, complex
• • Sequence: list, tuple, range
• • Text: str
• • Set: set, frozenset
• • Mapping: dict
Operators in Python
• • Arithmetic: +, -, *, /, %
• • Relational: >, <, >=, <=
• • Logical: and, or, not
• • Bitwise: &, |, ^, ~, <<, >>
Special Operators & Type
Conversion
• • Identity Operators: is, is not
• • Membership Operators: in, not in
• • Type conversion using int(), float(), str(), etc.

Python Programming Unit 1 Introduction to Python History of Python Why Python? Applications of Python

  • 1.
    Python Programming -Unit 1 Introduction to Python
  • 2.
    Introduction to Python •Python is a general-purpose, high-level programming language. • It supports multiple programming paradigms like OOP, procedural, and functional programming.
  • 3.
    History of Python •• Developed by Guido van Rossum in late 1980s. • • First released in February 1991. • • Named after Monty Python's Flying Circus.
  • 4.
    Why Python? • •Easy to learn and use. • • Versatile for different applications. • • Dynamic typing and interpreted nature.
  • 5.
    Applications of Python •• Web Development (Django, Flask) • • Data Science & AI • • Game Development • • IoT and Automation
  • 6.
    Writing & ExecutingPython Programs • 1. Open IDLE. • 2. Create a new file. • 3. Write Python script. • 4. Save with .py extension. • 5. Run using F5.
  • 7.
    Identifiers & ReservedWords • • Identifiers are names given to variables, functions, classes, etc. • • Must start with a letter or underscore (_), but not a digit. • • Python has 35 reserved words.
  • 8.
    Python Indentation • •Uses indentation instead of braces {}. • • Typically, 4 spaces per indentation level. • • Essential for defining blocks of code.
  • 9.
    Data Types inPython • • Numeric: int, float, complex • • Sequence: list, tuple, range • • Text: str • • Set: set, frozenset • • Mapping: dict
  • 10.
    Operators in Python •• Arithmetic: +, -, *, /, % • • Relational: >, <, >=, <= • • Logical: and, or, not • • Bitwise: &, |, ^, ~, <<, >>
  • 11.
    Special Operators &Type Conversion • • Identity Operators: is, is not • • Membership Operators: in, not in • • Type conversion using int(), float(), str(), etc.