176k views
16 votes
Write a python program that:

- Defines a tuple of 5 integer numbers
- prints the tuple
- Appends a new value to the end of the tuple
- prints the tuple again

1 Answer

8 votes

Answer:

Step-by-step explanation:

The following code is written in Python and creates a tuple of 5 integer numbers and then prints out the tuple. Tuples are immutable objects meaning that they cannot be changed at all. Therefore, they have no append methods and cannot have any values added or removed so the last two tasks of this question are impossible to accomplish.

my_tuple = (2, 5, 7, 9, 6)

print(my_tuple)

User Patrickz
by
6.9k points