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 π
Chat with our AI personalities
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.
There is no difference between procedural programing language & structure programing language.
C language is not a program, and it isn't an object-oriented language either.
c, c++, java, prolog, fortran, basic, ...
Python and Matlab
a faux code in programing is the action you want to complete only written in our language not the computers language, also a lot of people write a faux code before you write the programing it helps you understand what your system is going to do