Python Basics For Beginner

Check your understanding of Python basics.

1. What is the correct file extension for Python files?
2. Which function is used to get user input in Python?
3. The 'and' logical operator in Python returns True only if both operands are True.
4. Select all valid built-in data types in Python.
5. What is the output of print(2 + 3 * 2)?
6. What keyword is used to define a function in Python?
7. Which loop is used to iterate over items in a sequence (e.g., list)?
8. Which of these are valid Python variable names?
9. Python is a statically typed programming language.
10. What does the len() function return?
11. What symbol is used for single-line comments in Python?
12. Which operator is used for exponentiation in Python?
13. Select all comparison operators in Python.
14. Tuples in Python are mutable.
15. What is the output of print(str(123) + '45')?
16. What keyword is used to exit a loop before it completes all iterations?
17. Which of these are valid ways to create a list in Python?
18. Which method adds an element to the end of a list?
19. The 'elif' keyword is used to specify additional conditions in an if statement.
20. What is the default return value of a function with no return statement?
Answered 0 of 0 — 0 correct