Multiple choice

which command does NOT have a syntax error?

  1. print("hello)

  2. for i range(10):

  3. for line in file

  4. def myFunction():

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Option D is a valid function definition. Option A is missing a closing quote, B is missing the 'in' keyword, and C is missing a colon.