KnowledgeBoat Logo

Computer Science

Find the errors in following code fragment:


y = x + 5
print (x, Y)

Python Funda

42 Likes

Answer

There are two errors in this code fragment:

  1. x is undefined in the statement
    y = x + 5
  2. Y is undefined in the statement print (x, Y). As Python is case-sensitive hence y and Y will be treated as two different variables.

Answered By

22 Likes


Related Questions