Q. Find out the error(s) in following code fragments:

(i)

temperature = 90

print temperature


(ii)

a = 30

b = a + b

print (a And b)


(iii)

a, b, c = 2, 8, 9

print (a, b, c)

c, b, a = a, b, c

print (a; b; c)


(iv)

X = 24

4 = X


(v)

print ("X="X)


(vi)

else = 21 - 5


Answer =

(i)
temperature = 90
print (temperature)

(ii)
a = 30
b = a + b
print (a, b)

(iii)
a, b, c = 2, 8, 9
print (a, b, c)
c, b, a = a, b, c
print (a, b, c)

(iv)
X = 24
X = 4


(v)
1. "X" is not defined
2. It should be print ("X=",X)
There should be "," .

(vi)
"else" Keywords cannot be used as identifiers.

20 Comments

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

  1. Really helpful thank you so much ❤️

    ReplyDelete
  2. Please explain fifth one.

    ReplyDelete
    Replies
    1. In statement print ("X="X)
      there should be print ("X=",X)

      Delete
  3. thank you for this much information i wanted it to check my answers

    ReplyDelete
  4. Plz send all the answers

    ReplyDelete
  5. Super helpful thx a lot may good bless u

    ReplyDelete

Post a Comment

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

Previous Post Next Post