📍 Lawyer Pet Ext., Ongole, AP 📞 +91 9848517191 ✉️ support@kkccinfo.com
Python Courseware

Python Programming Complete Course Manual

Syntax, List Comprehensions, Lambda Functions, OOPs, Exception Handling, File I/O & Automation.

1. Introduction & Dynamic Typing

Python was created by Guido van Rossum and released in 1991. It is a high-level, interpreted, dynamically typed programming language known for its clean readability and extensive library ecosystem.

Data StructureMutabilitySyntax ExamplePrimary Use Case
listMutable[1, 2, "KKCC"]Ordered collections, flexible element modification
tupleImmutable(10, 20, 30)Fixed constants, dictionary keys, record tuples
dictMutable{"name": "Java"}Key-Value pair lookups, JSON representations
setMutable{1, 2, 3}Unique element sets, mathematical set operations

4. List Comprehensions & Lambda Functions

Python Expressions
# List Comprehension with Conditional Filtering
numbers = [1, 2, 3, 4, 5, 6, 7, 8]
squares_even = [x**2 for x in numbers if x % 2 == 0]

# Lambda Function & Map Filter
multiply = lambda a, b: a * b
filtered = list(filter(lambda x: x > 10, squares_even))

print("Filtered Even Squares:", filtered)

5. Object-Oriented Python (OOP)

Python Class & Inheritance
class Student:
    def __init__(self, name, course):
        self.name = name
        self.course = course

    def display(self):
        return f"Student {self.name} is enrolled in {self.course} at KKCC Ongole."

class ScholarStudent(Student):
    def __init__(self, name, course, gpa):
        super().__init__(name, course)
        self.gpa = gpa

s1 = ScholarStudent("Lakshmi", "Python Automation", 9.5)
print(s1.display())

6. Exception Handling & File I/O

File Handling
try:
    with open("students.txt", "w") as f:
        f.write("KKCC INFO SYSTEMS - Ongole Campus\nPython Courseware 2026\n")
except IOError as e:
    print(f"File Error: {e}")
📝 Python Student Exercises & Homework
  1. Write a Python program to extract prime numbers from a list using list comprehensions.
  2. Create a class BankCustomer with deposit, withdraw, and check balance methods.
  3. Write a script to parse student records from a JSON file and filter GPA > 8.0.