Python Control Structures
Python Control Structures - Important Points
16. | Which keyword is used to define a block of code in Python? |
---|
A. block
B. segment
C. suite
D. module
View Answer Discuss Work SpaceAnswer: option c
Explanation:
In Python, a block of code is defined using a suite, which is a group of statements that are indented together.
17. | Which statement is used to create a list in Python? |
---|
A. [ ]
B. ( )
C. { }
D. | |
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The [ ] brackets are used to create a list in Python.
18. | Which statement is used to create a dictionary in Python? |
---|
A. [ ]
B. ( )
C. { }
D. | |
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The { } brackets are used to create a dictionary in Python.
19. | Which statement is used to create a tuple in Python? |
---|
A. [ ]
B. ( )
C. { }
D. | |
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The ( ) parentheses are used to create a tuple in Python.
20. | Which statement is used to create a set in Python? |
---|
A. [ ]
B. ( )
C. { }
D. | |
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The { } brackets are used to create a set in Python.