Robotics & Artificial Intelligence
Fill in the blanks:
- Python offers a wide range of data structures often referred to as ……………. .
- In an ……………. list, the square brackets [] do not hold any value.
- The ……………. function in Python can be used when we want to know the number of elements stored in a list.
- A tuple is an ……………. sequence of items having any number of elements of different data types.
- Sorting is the process of ……………. and displaying the elements of a list in ascending or descending order.
Answer
- Python offers a wide range of data structures often referred to as sequences.
- In an empty list, the square brackets [] do not hold any value.
- The len() function in Python can be used when we want to know the number of elements stored in a list.
- A tuple is an ordered sequence of items having any number of elements of different data types.
- Sorting is the process of arranging and displaying the elements of a list in ascending or descending order.
Related Questions
The …………… keyword is used to print the list elements in descending order.
- Sort
- Index
- Descend
- Reverse
Tuples are …………… objects.
- Mutable
- Immutable
- Non-static
- Infinite
Write a Python program to demonstrate the difference between lists and tuples.
Write a Python program to display all the elements of a tuple using the for loop.