This is an inverted class, given in conjunction with similar classes at Saint Xavier College (autonomous) in Ahmedabad, Gujarat, India, and Xavier Institute of Engineering in Mumbai, Maharashtra, India.
Syllabus
For the complete syllabus, click here.Office Hours
Contents
Day 1: Importance of Python, Getting Python
Core
We learn how to install and interact with Python. We start our forray into Python syntax with understanding simple arithmetic expressions involving numbers and strings. In the additional Extension section, we look at the representation of numbers to understand the role of arbitrary length integers in Python and numerical errors for floating point numbers in Python.
- Foundations and Installing Python [installing.pdf] [installing.mp4]
- Starting Python [starting.pdf] [starting.mp4] [starting.py]
- Expressions [installing.pdf] [installing.mp4]
Extension
- Number Representation [representationNumbers.pdf] [representationNumbers.mp4]
- Python for kids: The Turtle Module
[forkids.pdf]
[forkids.mp4]
Sample Python files: [heptagram.py] [pentagram.py] [drawing.py]
Exercises
- Solved exercises [exercises.pdf] [exercises.mp4]
- Graded exercises [exercisesgraded.pdf]
Day 2: Types, Statements, Variables
Today we learn our first 'useful' program, a converter program.
Core
- Types in Python: [type.pdf] [type.mp4]
- The print statement: [print.pdf] [print.mp4]
- The input statement: [input.pdf] [input.mp4]
- Variables: [variables.pdf] [variables.mp4]
- Statements: [statements.pdf] [statements.mp4]
Exercises
- Solved Exercises: [Exercises] : [Solutions ]
Week 1 Resumen and Laboratory
First try out your prowess by solving the problems [click here for lab.pdf]. You can follow the presentations or you can access directly the solutions to compare.
Presentations
- Straightline programming: Quadratic equations [quadratic.pdf] [quadratic.mp4] [quadratic2.py]
- Conversion program [conversion.py]
- Straightline programming: Heron's Method aka Babylonian Method [heron.pdf] [heron.mp4] [heron_one.py]
- Raphson-Newton example [newton-raphson.py]
Day 3: Control flow: Alternative Statement
Core
Extension: Algorithms
- Algorithms [Algorithms.pdf] [Algorithms.mp4]
Day 4: For Loops
- The Idea of Repetition
- For Loops
- Nested For Loops [nesting.pdf] [nesting.mp4] [diophantine.py] [cryptarithmetic.py]
- Exercises with ASCII Art [asteriscs.pdf] [asteriscs.mp4] [chessboard.py] [tree.py]
Week 2 Laboratory
Solved Exercises
Day 5: While Loops
- While loops: [while1.pdf] [while1.mp4] [pirates1.py] [pirates2.py] [pirates3.py] [pirates4.py] [sinecalc.py]
- The break statement: [while2.pdf] [while2.mp4]
- The continue statement and finding amicable numbers [while3.pdf] [while3.mp4] [amicable.py]
Day 6: Functions
- Functions [functions.pdf]
- Functions of Functions [functionsOffFunctions.pdf]
- Functions in action: Lotka-Volterra Population Model [LotkaVolterra.pdf]
Week 3 Laboratory
Solved Exercises
Day 7: More on Functions
- Named parameters: [named.pdf] [named.mp4] [amicable.py]
- Default parameters [named.pdf] [default.mp4]
- Modules [named.pdf] [default.mp4] [dies.py]
- Scopes [scopes.pdf] [scopes.mp4] [scope_examples.py]
- Anonymous Functions [anonymous.pdf] [anonymous.mp4] [anonymous.py]
Day 8: Lists
- Defining lists: [lists1.pdf]
- Manipulating lists: [lists2.pdf]
- Ranges (Repetition): [lists3.pdf]
- Example: Sieve of Eratosthenes: [lists4.pdf]
- Solved Exercises: [SE1.pdf]
- Solutions to Solved Exercises: [SES1.pdf]
Week 4 Exercises
- Solved exercises [exercises.pdf] [solutions.pdf]
Day 9: Strings
- Defining and operating on strings: [strings1.pdf] [strings1.mp4]
- String methods: [strings2.pdf] [strings2.mp4]
- String processing: [strings3.pdf]
- Python code:
Day 10: Interacting with Files
- Files in Python: [files1.pdf] [files1.mp4]
- File Processing: [files2.pdf] [files2.mp4]
- Encodings: [files3.pdf] [files3.mp4]
- Encodings: [files5.pdf] [files5.mp4]
- Python code:
Week 5 Laboratory
- List and String manipulation: [stringsexercises.pdf] Solutions: [strings.py]
- The Hangman Game: [lab.pdf] [lawler.txt] [vocabulary.txt]
- The Hangman Game Solution: [hangman.py]
- Denver Crime Statistics:
Day 11: String Formatting
- f-strings: [formatting1] [formatting.mp4]
- Formatting with format: [formatting2.pdf] [formatting2.mp4]
Day 12: Important Modules
- Modules: [modules1.pdf] [modules1.mp4]
- Random module: [modules2.pdf] [modules2.mp4]
- Monte Carlo Simulation: [modules3.pdf] [modules3.mp4]
- os module: [modules4.pdf] [modules4.mp4]
- Programs: [montecarlo.py] [rand.py]
Week 6 Laboratory
- Amortization Calendar
- Gambling simulation (or why you should not gamble)
- lab.pdf
- lab5.mp4 recording
- mortgage_calculator.py
- gambling.py
Day 13: Dictionaries
- Dictionary definition: [dict1.pdf]
- Dictionary manipulation: [dict2.pdf]
- Gathering file statistics: [dict3.pdf] [alice.py]
- Dictionary class recording: [dict.mp4] Recording
Day 14: Tuples, sets, and frozen sets
- Sets and Frozen Sets: [tuples1.pdf] [tuples1.mp4]
- Tuples, tuple assignment, tuple extraction, functions with multiple return values [tuples2.pdf]
Day 15: Comprehension
- Repetition: Strings: : [comprehension1.pdf] [comprehension1.mp4]
- Repetition: Loops: [comprehension2.pdf] [comprehension2.mp4]
- Elements of Functional Programming: [comprehension3.pdf] [comprehension3.mp4]
- Comprehension: [comprehension4.pdf] [comprehension4.mp4] [comprehension4.mp4]
Week 7 Laboratory: Breaking Classical Encryptions
- Presentation Video (mp4) [click here]
- Presentation (pdf) [click here]
- Presentation (key) [click here]
- Presentation (pptx) [click here]
- caesar.py [click here]
- ex1.py [click here]
Day 16: Recursion
- Recursive functions and memoization [recursion.pdf] [recursion.mp4]
Week 8 Laboratory
Day 17: Exceptions
- Exceptions: [exceptions.pdf] [exceptions.mp4]
Day 18: Classes
- Object Oriented Programming Paradigm: [classes1a.pdf] [classes1a.mp4]
- Defining classes: [classes1.pdf] [classes1a.pdf]
Week 9 Laboratory
- The rational class
- The address class
- The name class
Day 19: Classes 2
- Dunder Methods: [dunder.pdf] [dunder.pdf]
- Operator Overloading and the Rational class: [overloading.pdf] [overloading.mp4]
Day 20: Application: Decision trees in Machine Learning
- Python iterators and generators
- The final clause
- Building a decision tree on the Iris data set
- Penguins
- Installing MySQL
- SQL basics
- Using SQL from Python
- Networking with Sockets
- Python Sockets
- Introduction to GUI: Presentation video
- Canvas: Presentation video
- Buttons: Presentation video
- Bindings: [bindings.pdf] [bindings.mp4]
- Input and Output: [inputOutput] video
- Animation: [animation] video
- Lunar Lander
- Challenge Project: Robots