String indexing example added (#30300)
* String indexing example added * Update index.md
This commit is contained in:
committed by
Randell Dawson
parent
a4de1ad170
commit
f8e613862e
@ -318,4 +318,9 @@ a = [10,20,30]
|
|||||||
b = [10,20,30]
|
b = [10,20,30]
|
||||||
|
|
||||||
print a is b # prints False (since lists are mutable in Python)
|
print a is b # prints False (since lists are mutable in Python)
|
||||||
|
|
||||||
|
print(str1[:4])
|
||||||
|
# Above code gives the output as Free
|
||||||
|
print(str[4:])
|
||||||
|
# Above code gives the output as CodeCamp
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user