Which of the following is not a valid operator in Python?

2023

Which of the following is not a valid operator in Python?

  1. A.

    ==

  2. B.

    =>

  3. C.

    //

  4. D.

    **

Attempted by 1999 students.

Show answer & explanation

Correct answer: B

Answer: => is not a valid Python operator. Explanation (English): == : equality operator — compares two values and returns True if they are equal.

=> : not an operator in Python. For 'greater than or equal to' use >=. The symbol => is used in some other languages but is invalid in Python expressions.

Explore the full course: Rssb Senior Computer Instructor