```
name = "yashasvi"
print(name[0:3])
```
This code in codechef compiler gives result “yash”, it should give result “yas”.
According to the documentation of python.
```
name = "yashasvi"
print(name[0:3])
```
This code in codechef compiler gives result “yash”, it should give result “yas”.
According to the documentation of python.
In programming language counting always start from 0 . If you want to slice down first three alphabets of yashasvi try this
Print(name[0:2])
its correct , bcz when slicing a[0:3]
it includes the 0th index and excludes 3rd index
that’s why it gives result up to index 2
Okay, got it, thank you everyone