Python Crash Course for loops! #4

 Hi Everyone,

This is what I have been messing about with tonight, just doing loops over and over again! 

for loops are made up of the variable and value:

pizza = ["pep", "cheese", "donner"]
for pizzas in pizza:
print(f"I like {pizzas.upper()}")
print(f"My fav type of pizza is {pizza[0]}")

animals = ["Dog", "Cat", "Chicken"]
for pets in animals:
print(f"{pets} are my fav!")
print(f"a {pets} would make a great pet")
print("These animals are great!")

In this code the value of pizzas is the variable and is getting assigned the value of pizza, the next statement is then indented and printed.

Comments

Popular posts from this blog

Python Crash Course Chapter 1-2! #1

I PASSED! Cisco CCNA 200-301! Experience & Where I'm going from here!

Python Notes #6 Functions