Q. Find the errors in following code fragment:


(a)

Y = x + 5

print (x, Y)


(b)

print (x = y = 5)


(c)

a = input ('value')

b = a / 2

print (a, b)


Answer =


(a)

"x" is not defined.


(b)

There should be no use of special characters in the print statement.

So, the correct code is :-

print (x,"=",y,"= 5")


(c)

The string cannot divide.

6 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. Replies
    1. There should be no use of special characters in the print statement.

      So, the correct code is :-

      print (x,"=",y,"= 5")

      Delete
  2. Please explain c

    ReplyDelete
  3. pls explain me all from beginning

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post