(Solved):It is easy to confuse = and == operators in python. Write a test program containing the stement if floor = 13 What error message do you get? Write another test program containing the statement co… View Answer…

 

Question

It is easy to confuse = and == operators in python. Write a test program containing the stement

if floor = 13

What error message do you get? Write another test program containing the statement

count ==0

What happens when you run the program?

 

EXPERT ANSWER

If someone types

if floor = 13

in Python, he’ll get the following error since he needs to use ‘==’ operator for comparison:

Scroll to top