Robotics & Artificial Intelligence
Consider the following statement and answer the question:
data = ("name": "Arjit", "age": 24)
This statement:
- Will create a dictionary
- Will create a tuple
- Will produce an error
- Will create a set
Getting Started
2 Likes
Answer
Will produce an error
Reason — A dictionary in Python must be defined using curly braces {} with key–value pairs separated by a colon. The given statement does not use curly braces, so it results in an error.
Answered By
1 Like
Related Questions
Which of the following is/ are the features of Python?
- Object-oriented
- High-level
- General-purpose
- All of these
To define a dictionary in Python, which bracket is used?
- Curly{}
- Square[]
- Small()
- None of these
Which out of the following is a valid variable name?
- @val
- 9val
- _val
- int
The statement 5 % 4 will return …………… .
- 0
- 1
- 2
- 3