0
So I tried a = "a" while a <= "e": print(a) a = "a" + "1" print("Finished") and it said time limit exceeded
How do you do a while loop with letters?
5 odpowiedzi
+ 3
a = "a"
while a <= "e":
print(a)
a = chr(ord(a)+1)
print("Finished")
+ 2
ord() is to get the ascii code of the character
chr() is to get the character corresponding to the ascii code
+ 1
simply ur second line is not inside the while loop...
0
I don't get the chord thing
0
ok thanks