Computer Science
Identify the valid declaration of L:
L = [1, 23, 'hi', 6]
- list
- dictionary
- array
- tuple
Python List Manipulation
2 Likes
Answer
list
Reason — The given declaration L = [1, 23, 'hi', 6]
creates a list in Python. Lists are created using square brackets [] and can contain elements of different data types, including integers, strings, and other lists.
Answered By
1 Like
Related Questions
Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is:
- [0, 1, 2, 3]
- [0, 1, 2, 3, 4]
- [0.0, 0.5, 1.0, 1.5]
- [0.0, 0.5, 1.0, 1.5, 2.0]
Which is the correct form of declaration of dictionary ?
- Day = {1:'Monday', 2:'Tuesday', 3:'wednesday'}
- Day = {1;'Monday', 2;'Tuesday', 3;'wednesday'}
- Day = [1:'Monday', 2:'Tuesday', 3:'wednesday']
- Day = {1'monday', 2'tuesday', 3'wednesday'}
Identify the valid declaration of L:
L = {1: 'Mon', 2 : '23', 3: 'hello', 4: '60.5'}
- dictionary
- string
- tuple
- list
Which value type does input() return ?
- Boolean
- String
- Int
- Float