This Introduction to Computer Science and Programming using Python course is designed for students with minimal or no programming experience. The goal is to help students understand how computation can be used to solve problems. It also aims to build confidence in writing simple programs, allowing students from any major to achieve practical goals. The […]
This Introduction to Computer Science and Programming using Python course is designed for students with minimal or no programming experience. The goal is to help students understand how computation can be used to solve problems. It also aims to build confidence in writing simple programs, allowing students from any major to achieve practical goals. The course will use Python 3 as the programming language.
This lecture covers the basics of computation, introduces Python, and explores mathematical operations, variables, and types in Python. Students will learn about Python objects and how to structure Python programs.
We will discuss the core elements of programs such as strings, input/output, f-strings, operators, and branching. Key takeaway: Debug early and often. Start by writing small code snippets and testing them rather than writing a complete program. Use Python Tutor to debug code step by step.
This lecture introduces control flow and iteration using loops. We’ll cover both while
and for
loops, and emphasize practicing syntax. While loops continue as long as a condition is true, while for loops iterate over ranges or strings.
We explore iteration in simple programs like guess-and-check, binary numbers, and fractions in Python. Understanding binary numbers helps us see how machines store values. Guess-and-check helps solve problems by enumerating potential solutions.
This lecture explains the challenges of floating-point numbers and introduces approximation methods. Floating-point numbers cannot always be represented exactly in memory, leading to approximations in calculations.
We discuss simple algorithms like bisection search and Newton-Raphson. Bisection search takes advantage of problem properties, and we explore how decomposition and abstraction simplify code creation, modification, and maintenance.
An introduction to functions, decomposition, abstractions, and specifications. Functions encapsulate computations into black boxes, making them reusable and simplifying code. Functions run only when called and return a result.
This lecture delves deeper into functions as objects. Functions in Python are first-class citizens, meaning they have types, can be assigned as values, passed as arguments, or returned from other functions. Understanding scope and environments helps create clear and concise code.
This lecture covers lambda functions, tuples, and lists. Lambda functions are used for quick, one-time tasks. Tuples and lists are sequences that are indexed, with tuples being immutable and lists being mutable.
We explore list operations and mutability, covering mutation, aliasing, and tricky examples with loops. Lists are used for dynamic data, while tuples hold immutable data such as geographical coordinates.
We discuss aliasing, cloning, and the difference between shallow and deep copies of lists. List comprehensions are also covered, allowing for more concise data manipulation.
Further exploration of functions as objects, keyword arguments, default arguments, and various debugging techniques, including glassbox and blackbox testing.
This lecture covers exceptions and assertions—how to handle errors and raise assertion failures in Python.
Introduction to dictionaries, their keys and values, mutability, and iteration. Dictionaries map unique, immutable keys to any value, and they can be highly efficient for certain tasks.
This lecture introduces recursion, a programming technique for breaking problems into base cases and recursive steps. Recursion allows problems to be solved more effectively by breaking them down into smaller instances.
The concept of recursion is extended to indexable sequences like strings and tuples, demonstrating its application beyond numbers.
Introduction to classes, which enable code reuse and organization. Classes allow us to avoid naming conflicts in functions and use inheritance to extend or modify behavior.
This lecture explores the decomposition and abstraction within Python classes. By bundling data and behavior together, classes promote consistency in object usage.
We discuss inheritance, a mechanism that allows child classes to inherit properties and methods from parent classes. This facilitates hierarchical structures in programming.
A practical example involving fitness trackers demonstrates how to use classes for object-oriented programming and modularize code by grouping data and behavior together.
Learn to evaluate programs by measuring execution time, counting operations, and abstracting performance growth in relation to algorithm efficiency.
This lecture introduces Big O and Theta notation for comparing the efficiency of algorithms. We’ll learn how to describe algorithm performance and its upper and lower bounds.
We explore complexity classes to compare algorithm efficiency and use Θ notation for both upper and lower bounds to determine growth rates.
We discuss several sorting algorithms (BOGO sort, bubble sort, selection sort, and merge sort) and analyze their complexity.
This lecture covers plotting in Python, an essential tool for visualizing data and exploring trends. We’ll explore Python libraries for numerical and stochastic computations.
The course concludes with a focus on list access, hashing techniques, and simulations, summarizing key concepts and offering a final review of the material.
Discover top-rated online courses from leading platforms.