Python Exercise: Colon of a tuple
Python tuple: Exercise-8 with Solution
Write a Python program to create the colon of a tuple.
from copy import deepcopy #create a tuple tuplex = ("HELLO", 5, , True) print(tuplex) #make a copy of a tuple using deepcopy() function tuplex_clone = deepcopy(tuplex) tuplex_clone.append(50) print(tuplex_clone) print(tuplex)
('HELLO', 5, , True) ('HELLO', 5, , True) ('HELLO', 5, , True)
Visualize Python code execution:
The following tool visualize what the computer is doing step-by-step as it executes the said program:
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?