fbpx

Python

For loops with lists

Going off our attendance sheet example when we learned what lists are… …let’s imagine that we need to call attendance for the class. To do … Read More

Booleans

When working with comparison operators, we stated that they determine whether a condition returns true or false. “True” and “False” are not strings, integers, or … Read More

Endless loop illustrated

Working off of program we created while learning While loops… i = 0 while i <= 3:    print(i)    i += 1 …let’s imagine that we removed the … Read More

Nested conditionals

In order to learn what nested conditionals actually are, check out this template code: if condition:    if condition:        code to be executed if condition is true Notice … Read More

Logical operators

When learning elif statements, we utilized “or”… state = input(“What state do you live in?”) if state == “Ohio”:    print(“You live in the Midwest.”)elif state == “California” … Read More

Comparison operators

When learning if statements, we utilized “==”… state = input(“What state do you live in?”) if state == “Ohio”:    print(“You live in the Midwest.”) …to determine whether … Read More

What are conditionals?

Essentially, a conditional is a switch. For example, imagine a machine that has 3 buttons: Conditionals can do this same exact thing through the use … Read More

For loops with enumerate

Going off our for loop we coded to call attendance… names = [“Peter”, “Lila”, “Alex”, “Bella”] for x in names:    print(x) …what if we also wanted … Read More

Lists

Let’s say you teach at ABC Elementary School and it’s the first day of classes. You’ve got a small class of 4 students, and you … Read More

For loops

Let’s replicate the While loop we created counting from 0 to 3… …except with a For loop! How are these loops different? As stated in … Read More