Academy of Computing

Computing

Master of Computer Science

Python Fundamentals for Beginners

(5.0) | 0 rated

No software installation is required! The course covers Python basics, including inputs, outputs, essential data types, decision-making with if-else statements, and looping. By the end of the course, students will be equipped to undertake their own projects.

This course includes:
 13 Lesson Video
 0 Assignments


Getting Started with Python in Google Colab

Python leads in job postings in the US as of 2024. The course utilizes Google Colab, a web-based platform that doesn't require any software installation, making it accessible and user-friendly for coding exercises. Participants are guided to create a new notebook on Google Colab, execute their first code, and learn basic functionalities like running a code and adding both code and text sections to their files.

Understanding Input, Output, and Variables in Python

In the previous lesson, we explored output through examples like printing "Hello World" and simple addition, showing how the computer returns results. We introduced inputs, explaining how devices like keyboards and microphones capture information. The Python `input()` function was used to store user input in variables. The lesson concluded with an overview of variables as containers for data, setting the stage for a deeper exploration in the next lesson.

Variables vs. Constants: Key Concepts in Python

This lesson covers variables and constants. Variables, like changing a country name, can hold varying values, while constants, such as "hello world" or 22, remain fixed. We also discuss naming rules for variables: they must start with a letter or underscore, can't begin with a number, and are case-sensitive. The lesson emphasizes the importance of meaningful variable names and concludes with a distinction between variables and constants, setting up future lessons on data types.

Exploring Data Types in Python: Strings, Integers, and Floats

In the previous lesson, we introduced data types, which classify data in programming languages like Python. Similar to categorizing living and non-living things, data types help organize text and numbers. Textual data uses quotation marks, while numerical data does not. We covered four fundamental data types: string, integer, and float, the latter representing numbers with decimals. This highlights Python's ability to classify different types of data effectively.

Working with Strings: Key Operations and Techniques

This lesson covers the functionalities of string data types in programming. Strings can contain text, numbers, or both, enclosed in quotations. Key string operations include changing case with methods like capitalize, upper, and lower. It also explains determining string length, concatenating strings, and using placeholders for string formatting to insert variables. A unique operation is replicating strings by multiplying them, showcasing the ease of text manipulation in coding.

Working with Integers and Floats in Python

This lesson covers integers and floats in Python. Integers are whole numbers used in operations like addition and exponentiation, while floats are decimal numbers, often from division. Python provides methods to manipulate these numbers, such as obtaining the whole number from a division using the double slash and the remainder using the modulus operator. Additionally, floats can be rounded to a specific number of decimal places for more precise numerical control.

Understanding Boolean Data Types and Logical Operations in Python

This lesson focuses on the Boolean data type in Python, which has two values: true and false. Python is case-sensitive, so altering case can lead to errors. Boolean operations like 'and', 'or', and 'not' perform logical operations based on operand truth values. Comparisons can return Boolean outcomes, such as equality, inequality, and relational checks. It's essential to distinguish between assignment (single equals sign) and comparison (double equals sign) in Python syntax.

Mastering Input, Conversion, and Arithmetic in Python

This lesson explains how to input two numbers, add them, and print the sum in Python. Initially, inputs are treated as strings, causing concatenation instead of addition. The `int()` function converts inputs to integers for correct addition. A type error occurs when printing the sum with a string, fixed by using `str()` to convert the sum. The lesson also covers converting to `float` for decimals and `bool` for logical values, where non-zero numbers and non-empty strings become `True`.

Understanding Conditional Logic in Python

Today's lesson covers conditional clauses in Python for decision-making. We start with the "if" statement, executing code based on conditions, and introduce the "else" clause for alternative actions. We also explore "and" and "or" operators for handling multiple conditions. The "elif" statement is discussed for more complex scenarios, like a grading system, ensuring accurate outcomes based on hierarchical conditions. This highlights the importance of conditionals in programming.

Creating and Customizing Robots in Python

In this mini project, customers create customized robots by providing details like name, age, color, height, and superpowers. Upon entering, they are greeted and asked for this information. The robot's height determines if it’s classified as tall, with a threshold set at 1.5 meters. A summary is then printed, detailing the robot's name, age, color, height classification, and superpowers. For example, a robot named Mighty, aged 12, purple, 1.8 meters tall, and with superpowers, is created.

Exploring For Loops and Iteration in Python

Today, we explore loops, a key concept for repeating code. A "for" loop runs a block of code multiple times, with a counter variable like "i" tracking iterations. It starts at a specific value and increments until a stopping point. The loop can be adjusted for different start values, step sizes, or decrements. Indentation is key to separating looped code from other code. An example demonstrates using a "for" loop to sum numbers, including summing only even numbers with a conditional statement.

Mastering While Loops: Converting and Applying Iteration in Python

This lesson explains converting for loops to while loops. It shows how a for loop from 0 to 5 can be rewritten with a while loop by manually initializing the counter (i), checking the condition, printing, and incrementing i. An example of summing numbers from 1 to 100 is provided. The lesson also discusses when while loops are better, like rolling a die until a six appears, as they handle unknown iteration counts better than for loops.

Building an ATM Simulator: Applying Loops and Logic in Python

In this final project, participants will create a simple ATM simulator with a starting balance of one million dollars. Users can check their balance, deposit funds, withdraw funds, or exit the program. A continuous loop presents these options until 'exit' is selected. The simulator ensures valid amounts for deposits and withdrawals, verifying sufficient funds for withdrawals. This project consolidates learning by demonstrating conditional logic, loop control, and basic arithmetic operations.