I've decided to teach myself programming and am new to the science. I started with a book on python and often try write code that's more complex than the examples provided in the book.
To get to the point here is an example from the book about the if and elif statements.
To get to the point here is an example from the book about the if and elif statements.
print("1. Red") print("2. Orange") print("3. Yellow") print("4. Green") print("5. Blue") print("6. Purple") Choice = int(input("Select your favorite color: ")) if (Choice == 1): print("You chose Red!") elif (Choice == 2): print("You chose Orange!") elif (Choice == 3): print("You chose Yellow!") elif (Choice == 4): print("You chose Green!") elif (Choice == 5): print("You chose Blue!") elif (Choice == 6): print("You chose Purple!") else: print("You made an invalid choice!")