Q:

Swap two tuples in Python

0

Swap two tuples in Python

Given:

tuple1 = (11, 22)
tuple2 = (99, 88)

Expected output:

tuple1: (99, 88)
tuple2: (11, 22)

All Answers

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

Solution:

tuple1 = (11, 22)
tuple2 = (99, 88)
tuple1, tuple2 = tuple2, tuple1
print(tuple2)
print(tuple1)

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