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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *