i just started python after php and javascript but i am confused in this easy concept....i already search a lot about this on tutorialpoints or w3school but i find nothing
here is the example code
var1 = 'Hello-World!'
print("var1[:6]: ", var1[:6])
This code will print the output as Hello- but here where is the W word because a string always start from 0 value so w will also be printed .....
anyways now i decided to print every word seperately
print("var1[0]: ", var1[0])
print("var1[1]: ", var1[1])
print("var1[2]: ", var1[2])
print("var1[3]: ", var1[3])
print("var1[4]: ", var1[4])
print("var1[5]: ", var1[5])
print("var1[6]: ", var1[6])
and the output is
var1[0]: H
var1[0]: e
var1[0]: l
var1[0]: l
var1[0]: o
var1[0]: -
var1[0]: W
now i am really confused that why W is not printed in my first example code ?