LearnFrenzy
Sign in Take a free test

Operators and Expressions · Find the Error · Question 3

Error: using ++ 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
count = 0
count++
print(count)
  • A count must be declared as int
  • B Python has no ++ operator; write count += 1 Correct
  • C count++ must be in brackets
  • D It prints 1
Correct Answer: Option B

count++ is a SyntaxError. (++count parses as +(+count) and silently does nothing.)

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