Q. Find the errors: 

(a)

name = "HariT"

print (name)

name[2] = 'R'

print (name)

 

(b)

a = bool(0)

b = bool(1)

print (a == false)

print (b == true)

 

(c)

print (type (int('123')))

print (type(int ("Hello")))

print (type (str("123.0")))

 

(d)

 

pi = 3.14

print (type (pi))

print (type ("3.14"))

print (type (float ("3.14")))

print (type (float("three point fourteen")))

 

(e)

print ("Hello" + 2)

print ("Hello" + '2')

print ("Hello" * 2)

 

(f)

print ("Hello" / 2)

print ("Hello" / 2)

 

Answer =

 

(a)

Error in third line.

 

(b)

Error in third and fourth line.

 

(c)

Error in second line that int() function cannot change the string into integer.

 

(d)

Error in fifth line that float() function cannot change the string into decimal number.

 

(e)

Error in first line that string cannot added with number.

 

(f)

Error in both line that string cannot divide with number.

 

10 Comments

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

  1. You must start a online class of python :^):,-)

    ReplyDelete
  2. Thank you so much for the help! I've been studying from a pdf for the last year because of the lockdown and it didn't have the answer key and solutions. Thank you for publishing these answers and solutions!

    ReplyDelete
  3. Do you have any YouTube channel???

    ReplyDelete
  4. Please tell the exact error in ques (b)

    ReplyDelete
    Replies
    1. Because false is not written in inverted commas and f should capital in False. Similarly with True.

      Delete
  5. Please tell the exact error in a part

    ReplyDelete

Post a Comment

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

Previous Post Next Post