Computer Science, asked by ramkumarchak7879, 1 day ago

9. Write the output of the following. S = "Welcome to python world"
print(S[2 : 3])
print(S[2 : 10])
print(S[-2 : ])
print(S[-10:-2:2]) ​

Answers

Answered by priyanka18885
1

print(S[2 : 10]) is your answer

I can't conform the answer

Answered by srirajnambiar
0

Answer:

Write the output of the following. S = "Welcome to python world"

print(S[2 : 3])

print(S[2 : 10])

print(S[-2 : ])

print(S[-10:-2:2]) ​

answer is:-  print(S[2:3])  output is " l"

print(S[2:10]) output is "lcome to"

print(S[-2: ]) output is "ld"

print(S[-10:-2:2]) output id "to o"

Explanation:

in this question a String name S with the value "Welcome to python world " is define and to print the particular part of the string slicing concept of python is used, in slicing we slice a object using there index value the  first value represent the starting of index and the second value represent the ending but it does the print the value at last index it leave the value at last and the third value denote the no. of steps taken from start to stop, by default step is 1

To know about more click here,

https://brainly.in/question/31655938

To know about more click here

https://brainly.in/question/11924821

#SPJ2

Similar questions