Differentiate list and tuple with an example?
Answer / Kanhai Kumar Jha
Lists in Python are mutable, meaning their elements can be added, deleted, or modified. Tuples, on the other hand, are immutable; their elements cannot be changed once assigned. An example: lists_example = [1, 2, 3]; tuples_example = (1, 2, 3)
| Is This Answer Correct ? | 0 Yes | 0 No |
How do I use xrange in python 3?
Explain me what is a built-in function that python uses to iterate over a number sequence?
What are built in types in python?
Print the length of each line in the file ‘file.txt’ not including any whitespaces at the end of the lines?
Is python shell scripting?
What is the usage of help() function in python?
What are static methods for?
Explain how to create a multidimensional list.
Write a sample program in enumerate()function in python?
How do you write a range in python?
Explain the use of with statement?
What is the difference between range and arange in python?