Perfect yes.
Why is the output 0?
And back to your original question, why is the output 7?
text = 'Hello World'
alphabet = 'abcdefghijklmnopqrstuvwxyz'
01234567
index = alphabet.find(text[0].lower())
print(index)
Perfect yes.
Why is the output 0?
And back to your original question, why is the output 7?
text = 'Hello World'
alphabet = 'abcdefghijklmnopqrstuvwxyz'
01234567
index = alphabet.find(text[0].lower())
print(index)
The output 0 because ‘a’ is the first letter in the alphabet variable.
output 7 because h is number 7 in the alphabet variable.
for this code (also my question before):
text = 'Hello World'
alphabet = 'abcdefghijklmnopqrstuvwxyz'
01234567
index = alphabet.find(text[0].lower())
print(index)
output = 7
You got it nice work