Q. Predict the output:


tuple_a = 'a', 'b'

tuple_b = ('a', 'b')

print (tuple_a == tuple_b)


(a) 0

(b) 1

(c) False

(d) True


Answer :-


Option: (d) is correct. Because in python if we write two or more characters separated by comma then it becomes a tuple.

4 Comments

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

  1. Replies
    1. No, condition give True or Flase not 1 or 0.

      Delete
  2. It is (c)
    tuple_a is a string. It can't be equal to a tuple

    ReplyDelete
    Replies
    1. You are wrong. Please run the code in your pc.

      Delete

Post a Comment

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

Previous Post Next Post