You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# print(str1[:6]) print "Lokesh" because it's starting default value is 0
# print(str1[0:]) print "Lokesh" because it's Last default value is string length
# print(str1[:]) print complete string becuse starting default value is 0 and last value is string length
# print(str1[1]) print o because index start from 0
# print(len(str1)) print string length
# print(str1[0:6]) print Lokesh and in this 0 is included and 6 is exclude it will go from 0 - (n-1), so we have to give 1 extra index
# print(str1[0:25]) print complete string
# print(str1[0:6:2]) print "Lks" because first it will go from[0:6] that is lokesh and then[0:6:2] means leave multiple of two or every second character.