0
How to skip first two elements of string?
How can I start indexing from 2nd element in string in python...please do help me
3 Antworten
+ 6
Learn how slicing works, it helps for such purposes
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2453/
+ 5
str="abcdefgh"
print(str[2:])
+ 5
Mr.Mohd Rafi [FOLLOW ME] ,
if you wanted to address / access the second character of the string with index [0] you can do it like already mentioned by SAN like this:
str="abcdefgh"
print(str[2:][0]) => result is 'c'