Python Basics For Beginner

Check your understanding of Python basics.

1. Which of the following is a valid variable name in Python?
2. Which of the following are immutable data types in Python?
3. In Python, the 'and' operator returns True only if both operands are True.
4. What is the output of the following code: print(2 + 3 * 2)?
5. What is the data type of the value 3.14 in Python?
6. Which of the following are valid ways to create a list in Python?
7. The '==' operator in Python checks for identity (memory location) of objects.
8. What keyword is used to define a function in Python?
9. What will be the output of: print('Hello' + ' ' + 'World')?
10. Which of the following loops are available in Python?
11. A list in Python can contain elements of different data types.
12. What symbol is used to denote a single-line comment in Python?
13. What is the result of '5' + '3' in Python?
14. Which of the following are valid comparison operators in Python?
15. The 'if' statement in Python must be followed by a colon (:).
16. What built-in function is used to get user input in Python?
17. Which data type is immutable in Python?
18. Which of the following are valid ways to initialize a string in Python?
19. Python uses indentation to define code blocks.
20. What is the output of len([1, 2, 3, 4])?
Answered 0 of 0 — 0 correct