+ 2
Can range function be used for characters/alphabets too in python?
7 Answers
+ 4
Not directly I suppose, but by obtaining the ASCII code of a character it might work. What triggered this question if I may ask?
Example (runs in Playground)
for c in range(ord('a'), ord('i')):
print(chr(c))
+ 3
Ipang Looks like we're thinking same https://code.sololearn.com/conR4Uas7A77/?ref=app
+ 3
https://www.sololearn.com/Discuss/1495591/?ref=app
+ 2
Thank you.
I have just started learning python and while learning about range function for numbers the question just came up in my mind.
+ 1
D'Lite
That's right bro!
+ 1
that might not be possible in python
- 1
Ye topper đđđ