CS1002 · Foundation · 4 credits

Programming in Python

Python from first principles — data types, control flow, functions, files, and the standard library.

Instructor Prof. Sudarshan Iyengar Term Every term Prereq CS1001

§ 1Calendar

  • Quiz 1—
  • Quiz 2—
  • End-term examination—

§ 2Previous Year Questions

§ 3Resources

Course material11

Notes3

CS1002 · Foundation · 4 credits

Syllabus

The official course syllabus, transcribed from the IITM BS Data Science & Applications course booklet.

§ 1Course Description

This course serves as the first formal introduction to programming in the programme. It introduces Python - used throughout the curriculum - while developing foundational problem-solving and algorithmic skills.

Lectures-Tutorials-Practicals-Credits: 4-0-0-4

§ 2Faculty

§ 3Week-by-week

Week 1: Programming basics - Replit, variables, data types, operators, strings; Common errors.

Week 2: Variables and dynamic typing; Operators and expressions; Strings (methods, escape characters, applications); Conditional statements (if, else, elif); Importing libraries.

Week 3: Iteration - while, for, nested loops; Range; Loop control (break, continue, pass); Formatted output; Applications.

Week 4: Lists, sets and tuples; List comprehensions; Introduction to functions; Function types and arguments.

Week 5: Dictionaries; Functions and scope; Iterators and generators; Functional tools; Applications (sorting, matrix multiplication).

Week 6: Practice Problems I

Week 7: Practice Problems II

Week 8: File handling - reading and writing; Handling large files; Applications (Caesar cipher, genetic sequences).

Week 9: Recursion - concepts and applications; Recursive problem solving (searching, sorting); Binary search (iterative and recursive).

Week 10: Exception handling; Introduction to object oriented programming; Classes and objects; Attributes and methods; Inheritance and method overriding.

Week 11: Numerical and data libraries - NumPy, Pandas (Series, DataFrames); Data visualization with Matplotlib.

Week 12: Course Summary

CS1002 · Foundation · 4 credits

OPPE

Solved questions for the Programming in Python online proctored programming exams (OPPE 1 and OPPE 2).

§ 1Practice and past questions