Here is the script: alphabets = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] i = input("Press any English alphabet: ") current = alphabets.index(i) print(current) next = current+1 print(next) print(alphabets.index(next))
I am getting a ValueError. And as you can see, I just trying to get the next item. So is there any way I can get same functionality in less line of codes? _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor