Skip to content

gagan-iitb/CS100-IntroProgramming

Repository files navigation

CS100-IntroProgramming

Introduction to Problem Solving with Computers Using Python Programming

This course will introduce you to problem-solving using programming. Beginning with simple tasks like evaluating mathematical expressions, calculating income-tax, to solving JEE problems (maths, physics, chemistry), we will gradually move on to engineering problems from all branches of engineering (mechanical, electrical, mechatronics, computer). We will focus on building logic, learning design patterns such as modularity, establishing program correctness, debugging, testing, and efficiency.

Honor code:

https://web.stanford.edu/class/cs109/handouts/honorCode.html

  • Rule 1: You must not look at solutions that are not your own.
  • Rule 2: You must not share your solutions with other students.
  • Rule 3: You must indicate on your submission any assistance you received.
  • Rule 4: Don't ask an LLM/Google/ChatGpt/Gemini etc. to solve homework for you
  • Please be aware: all submissions are subject to automated plagiarism detection
  • Discuss ideas together, but do the coding on your own... Perhaps the only way you may fail this course is by engaging in dishonesty

Lectures, Tutorials and Labs

Monday: 9:30 am-10:25 am -- Lecture 1 -- LH300
Thursday: 9:30 am-10:25 am -- Lecture 2 -- LH300

Tuesday: 8:30 am to 9:30 am Tutorial for entire class -- LH300

Labs are in ED1 Tuesday ---> Batch 2 (ED1 Room 320) and Batch 6 (ED1 room 312)
Wednesday ---> Batch 3 (ED1 Room 106) and Batch 5 (ED1 room 312)
Thursday ----> Batch 4 (ED1 Room 106) and Batch 1 (ED1 room 312)

Ed1 room 312 has a capacity of 32. First 32 students on Batches 6,5 and 1 can be seated in ED1 room 312 while others can be seated in TL1 (Ed1 room 106). Eventually, the ED1 room 312 may be used for students that need more help in the respective batches for the day.

Office Hours* During office hours, you can meet the instructor and ask your questions, doubts etc. Friday, ED1 Room 312 (12:30 p.m. - 1:30 p.m.)

After Hours Lab Timings and Volunteers

Day Start Time End Time Name
Monday 6:00 PM 8:00 PM Ishaan Shukla
Tuesday 11:30 AM 1:30 PM Sharvari
6:00 PM 8:00 PM Shaoni
Wednesday 11:30 AM 1:30 PM Sandeep Mohan
6:00 PM 8:00 PM Remalya
Thursday 10:00 AM 12:00 PM Hetvi
6:00 PM 8:00 PM Fenil Devganiyab
Friday 2:00 PM 4:00 PM Hasanna
6:00 PM 8:00 PM Prasanna
Saturday 9:30 AM 11:30 AM Dheeraj
11:30 AM 1:30 PM Siddhant Pinetar
2:00 PM 4:00 PM Daya
4:00 PM 6:00 PM Ananya
6:00 PM 8:00 PM Jaswanth
Sunday 2:00 PM 5:00 PM Abdul Karim
6:00 PM 6:00 PM Divyansh

Weekly Schedule

Week 1: Computer Fundamentals

  • What is Computer Science?
  • Can all problems be solved by computers? Undecidability, Halting problem
  • Algorithms: pseudocode, flowcharts
  • Limitations of computers
  • Lab: scratch programming

Week 1.1: Scratch, Flowcharts, Programming

  • Types of Programming Languages
  • Interpreters vs Compilers
  • Flowgorithm
  • Conditional Statements: if, if-else, elif
  • Loops: for, while
  • Why Python?
  • Lab: Flowgorithm

Week 1.2: Models of computing

  • Math for computer scientists: PMI
  • Practice with algorithm development
  • Imperative model of computing
  • Functional model of computing
  • Lab: Turtle graphics, game development in Python, Python basics

Week 2: Python Basics & Operators, Control Flow (If, Loops)

  • Python installation & syntax
  • Python IDEs: Jupyter Notebook, Spyder, VS Code, PyCharm
  • Virtual Environment in Python
  • Variables and Keywords
  • Data types overview
  • Operators:
    • Arithmetic
    • Relational
    • Logical
    • Assignment
    • Membership
    • Identity
  • input() and print()
  • Comments and indentation
  • Common File Extensions
    .png, .jpg, .csv, .txt, .py, .ipynb, etc.
  • Data Types
    int(), float(), str(), bool(), etc.

Week 3: Strings & Console I/O

  • Creating strings and using methods:
    upper(), lower(), find(), replace(), slicing, etc.
  • String formatting: f-strings, .format()
  • Escape characters & raw strings
  • Formatted input
  • Number Systems
    Binary, Decimal, Hexadecimal, Octal
  • ASCII & Unicode
  • Type Casting
  • Loop controls: break, continue, pass
  • range() function
  • Nested loops
  • Simple pattern printing

Week 4: Lists and Tuples

  • List operations and methods
  • Nested lists
  • Tuples and immutability
  • Tuple unpacking
  • Memory representation: list vs tuple
  • List comprehension

Week 5: Sets and Dictionaries

  • Set operations: union, intersection, difference
  • Set methods
  • Dictionary creation, access, and methods
  • Looping through dictionaries
  • Nested dictionaries
  • get(), setdefault(), fromkeys() methods

Week 6: Functions and Recursion

  • Defining functions
  • Parameters and return values
  • Default & keyword arguments
  • Variable-length arguments: *args, **kwargs
  • Scope: local vs global
  • Recursion basics and examples

Week 7 : Midsem Examination, Midsem Break


Week 8: Comprehensions, Memory & Copying

  • List, Set, Dictionary comprehensions
  • Shallow Copy vs Deep Copy: copy() and deepcopy()
  • Comparison: is vs ==
  • Memory allocation: id(), mutability
  • del statement

Week 9: Functional Programming & Modules

  • Built-in functional tools: map(), filter(), reduce()
  • Lambda expressions
  • Intro to popular libraries: numpy, pandas, matplotlib
  • Importing modules: import, from
  • Built-in modules: math, random, datetime
  • Writing your own module

Week 10: OOP in Python

  • Classes and Objects
  • __init__ method
  • self and instance attributes
  • Encapsulation and abstraction
  • Inheritance: single, multiple
  • Method overriding
  • Composition

Week 11: File I/O & UNIX Commands

File Handling

  • open(), read(), write(), close()
  • File modes: r, w, a, rb, etc.
  • Exception handling: try, except, finally, raise

UNIX Essentials

  • Basic commands: ls, cd, pwd, mkdir, rm, touch, cat
  • File permissions: chmod, chown
  • Piping & redirection
  • Navigating folders and environment variables

Week 12: Copilot & LLMs for Coding

  • Using GitHub Copilot and AI tools
  • Introduction to LLMs (Large Language Models)
  • Prompt engineering for coding tasks
  • Algebra and Numerical Analysis:
    • Automatic Differentiation
    • Integration
  • System of Linear Equations:
    • Gaussian Elimination (with code)

About

Introduction to Problem Solving with Computers Using Python Programming

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages