My issue
how and where to use debug
My code
# Debug the code below to solve the problem
var = " String "
print(var[1:3])
Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone
how and where to use debug
# Debug the code below to solve the problem
var = " String "
print(var[1:3])
Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone
you have to use Slicing.
And the syntax for the slicing is var[start:stop:jump]
where in square bracket we use indexing to get the desired output.
So according to the question you have to get 3 output
therefore you have to start from 0 to 3.
hence it will be like this
var = “String”
print(var[0:3])