answersLogoWhite

0

A tuple is a collection in Python that is ordered and cannot be changed (immutable) after creation.

# Creating a tuple

my_tuple = ("apple", "banana", "cherry")

# Accessing elements

print(my_tuple[0]) # Output: apple

For more Python tutorials, visit jiten.fun πŸš€

User Avatar

jitender Thakur

Lvl 2
βˆ™ 1mo ago

Still curious? Ask our experts.

Chat with our AI personalities

JudyJudy
Simplicity is my specialty.
Chat with Judy
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
DevinDevin
I've poured enough drinks to know that people don't always want adviceβ€”they just want to talk.
Chat with Devin
More answers

In Python, a tuple is simply a list of immutable objects. The two main differences are that a list is initialised using square brackets, while a tuple is initialised with parenthesis and you cannot remove or modify elements of a tuple, but you can with a list.

User Avatar

Wiki User

βˆ™ 9y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What are tuples in the python programing language?
Write your answer...
Submit
Still have questions?
magnify glass
imp