What is the difference between list and tuples in python?
Answer / Hansraj Meena
In Python, lists are mutable, meaning you can change their contents, while tuples are immutable, meaning once they are created, you cannot modify them. To create a list, use square brackets [ ], and to create a tuple, use parentheses ( ). Here is an example: nn```pythonnmy_list = [1, 2, 3]nmy_tuple = (4, 5, 6)nmy_list[0] = 'a' # valid for listsnmy_tuple[0] = 'a' # generates an error
| Is This Answer Correct ? | 0 Yes | 0 No |
How can I evaluate an arbitrary python expression from c?
where can I get the study material for python
Can I use python to make a website?
What are “special” methods in python?
Is python is easy?
Explain help() and dir() functions in python?
Does python have a built in function for string natural sort?
What are the built-in type does python provides?
What are decorators in python and how do you use them?
What is the language from which Python has got its features or derived its features?
What is the necessity to use pass statement in python program?
Explain how to delete a file in Python?