LearnFrenzy
Sign in Take a free test

Python Basics and Syntax · Find the Error · Question 3

Error: missing colon after if Answer, explanation & discussion

  • Find the error
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 3 Back to Exercise

Python refuses to run the program below. Which statement correctly describes the problem?

main.py
temperature = 38
if temperature > 37
    print("Fever")
  • A SyntaxError: the if header must end with a colon Correct
  • B temperature must be a float
  • C The comparison should use =>
  • D print must not be indented
Correct Answer: Option A

if, elif, else, for, while, def and class headers all end with a colon.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links