How to use string with negative index value that start from end of string in Python

1 Answer

0 votes
s = "python"
        
print(s[-1])
print(s[-2])
print(s[-3])
print(s[-4])
print(s[-5])
print(s[-6]) 
 
  
  
'''
run:
  
n
o
h
t
y
p
  
'''

 



answered Nov 16, 2019 by avibootz
...