简体   繁体   中英

printing characters of string from the end to the beginning using range in python

i want it to print every character in the string but from the end to the beginning of the string (inverted),it does not show any syntax error so whats the problem. i tried using print i in range(end,beginning) method but it does not show any output. but it does not say its a syntax error or anything

s="John000Doe000123"
for i in range(len(s),0) :
 print (s[i])
for c in s[::-1]:
    print(c)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM