alphabet = "abcdefghijklmnopqrstuvwxyz"
alphabetList = []
for i in alphabet:
alphabetList.append(i)
print(alphabetList)
Determines where the alphabet is in the loop
letter = input("What letter would you like to check?")
i = 0
while i < 26:
if alphabetList[i] == letter:
print("The letter " + letter + " is the " + str(i) + " letter in the alphabet")
i += 1
When adding in a letter you can find where the letter is in the alphabet
letter = input("What letter would you like to check?")
for i in alphabetList:
count = 0
if i == letter:
print("The letter " + letter + " is the " + str(count) + " letter in the alphabet")
count += 1
changing outcome to odd numbers
evens = []
i = 0
while i <= 10:
evens.append(i)
i += 2
print(evens)
outputs 0-10
odds = []
i = 0
while i <= 10:
odds.append(i)
i += 2
print(odds)
0-10 using the loops