Q. What is the problem with the following fragments?


(i)

a = 3

    print (a)

b = 4

    print (b)

s = a + b

    print (s)


(ii)

name = "Prejith"

age = 26

print ("Your name & age are", name + age)


(iii)

a = 3

s = a + 18

a = "New"

q = a / 10


Answer =

(i)
Indentation is present in print statement.

(ii)
String and number cannot add.

(iii)
String and numbers cannot divide.

5 Comments

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

Post a Comment

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

Previous Post Next Post