L Lê Minh Member Sep 20, 2021 #1 What will be the output of the following Python code? Code: >>> import collections >>> a=collections.namedtuple('a',['i','j']) >>> obj=a(i=4,j=7) >>> obj A. a(i=4, j=7) B. obj(i=4, j=7) C. (4,7) D. An exception is thrown
What will be the output of the following Python code? Code: >>> import collections >>> a=collections.namedtuple('a',['i','j']) >>> obj=a(i=4,j=7) >>> obj A. a(i=4, j=7) B. obj(i=4, j=7) C. (4,7) D. An exception is thrown
Đ Đức Lưu New member Sep 20, 2021 #2 Answer: a Explanation: The above piece of code illustrates the concept of named tuples. Upvote 0 Downvote