question archive What is the output of print(tuple[2:]) if tuple = ( 'abcd', 786 , 2

What is the output of print(tuple[2:]) if tuple = ( 'abcd', 786 , 2

Subject:BusinessPrice:2.87 Bought7

What is the output of print(tuple[2:]) if tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 )?

   

( 'abcd', 786 , 2.23, 'john', 70.2 )

   

abcd

   

(786, 2.23)

   

(2.23, 'john', 70.2)

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

Answer:

The given tuple is as follows:

Index

0

1

2

3

4

Index

(reference to the last element’s position)

-5

-4

-3

-2

-1

Value

'abcd'

786

2.23

'john'

70.2

The index referencing 2: means 2nd element to last element.

Therefore “print(print(tuple[2:]))” prints (2.23, 'john', 70.2)

Related Questions