Python Control Structures
Python Control Structures - Important Points
6. | Which statement is used to skip the current iteration of a loop in Python? |
---|
A. break
B. continue
C. pass
D. skip
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The continue statement is used to skip the current iteration of a loop in Python.
7. | Which of the following is not a comparison operator in Python? |
---|
A. <
B. >
C. <=
D. :=
View Answer Discuss Work SpaceAnswer: option d
Explanation:
:= is the walrus operator in Python, which is used to assign a value to a variable as part of an expression.
8. | Which operator is used to check if two values are equal in Python? |
---|
A. =
B. ==
C. ===
D. !=
View Answer Discuss Work SpaceAnswer: option b
Explanation:
The == operator is used to check if two values are equal in Python.
9. | Which operator is used to check if two values are not equal in Python? |
---|
A. =
B. ==
C. ===
D. !=
View Answer Discuss Work SpaceAnswer: option d
Explanation:
The != operator is used to check if two values are not equal in Python.
10. | Which of the following is not a logical operator in Python? |
---|
A. and
B. or
C. not
D. nor
View Answer Discuss Work SpaceAnswer: option d
Explanation:
nor is not a logical operator in Python.