0
Alphabet question
How would I go about writing a code that asks for an input of a lowercase letter, then have the code print that letter and the rest of the alphabet starting with the variable letter? e.g. Enter a lowercase letter: (t) t u v w x y z Program Finished.
9 Antworten
+ 1
myletter = input("Type in a letter")
for x in range(ord(myletter), 123):
print(chr(x))
# or use
for x in range(ord(input("Type in a letter")), 123):
print(chr(x))
+ 1
~ swim ~ I understand that you are trying to make me think about this problem, its an efficient way for me to learn this way rather than just see the code made for me. Unfortunently i dont understand how the code above works so im still going to attempt my own variation with simpler things like if statements and while loops if thats possible :)
+ 1
Nathen Hong-
To supplement sololearn, try https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/
Most of what i know (and i till class myself as a beginner) I've learnt from these two sites.
0
~ swim ~ 6/13 on Control Structures