Q:

Write a python program to copy elements 44 and 55 from the following tuple into a new tuple.

0

Copy specific elements from one tuple to a new tuple

Write a program to copy elements 44 and 55 from the following tuple into a new tuple.

Given:

tuple1 = (11, 22, 33, 44, 55, 66)

Expected output:

tuple2: (44, 55)

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution:

tuple1 = (11, 22, 33, 44, 55, 66)
tuple2 = tuple1[3:-1]
print(tuple2)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now