Class 3 Reflection


In Class 3, we learned about iterations. Iterations repeat actions or functions over and over again. This is typically used to process, examine, or collect data. One type of iteration is the for statement. This repeats the code several times for the values in the range. Another type of loop statement is the while statement. While the statement is true, the code will continue to loop. I found that this class was relativley easy to understand. I finished the homework hacks in a decent amount of time, and it didn't take that long.

Homework 1:

killsPerGame = [12, 28, 21, 17, 19, 32, 24]

for kpg in range(10):
    print(killsPerGame)

Homework 2:

while True:
    user_input = input("Please enter your passcode: ")
    if user_input == "Cranberry75" :
        print("That's the right password!")
        break
    else :
        print("Wrong password. Please try again.")