Computer Science, asked by jayashreevirgo, 10 months ago

what will be the output of the following python code?
a=(1,2,4,3)
print (a[1:4])

Answers

Answered by jessicashegin
1

Answer:

(2,3,4)

Explanation:

Answered by suchindraraut17
1

Python Code Output

Explanation:

Output will be

(2,4,3)

print(a[1:4])

In this code 1 is starting index, and 4 is last index.

We will subtract from last index with starting index.

4-1=3

From starting index(1) to up to 3 index will be output.

On

0 index=1

1 index=2

2 index=4

3 index=3

Finally output will be (2,4,3)

Similar questions