Which of the following lines will throw an indentation error in Python?
- if True:
- print("Hello, world!")
- print("Python is fun!")
- print("Python is easy!")
The correct option is 4. It lacks proper indentation, which is essential in Python to define code blocks. An indentation error would occur in this case.
Loading...
Related Quiz
- For an infinite loop using the while construct, the typical condition used is while _______:
- What could be the possible reasons for a init.py file being empty in some packages?
- How do you convert a list of lists into a single flat list in Python?
- How do you create a loop that iterates as long as a specific condition is true?
- A ____ sort is a highly efficient sorting algorithm based on partitioning of an array of data into smaller arrays.