Level 1 : What will be the output of the following Python code?


import collections
 a=collections.namedtuple('a',['i','j'])
 obj=a(i=4,j=7)
 obj

Author: SandhyaR | Tags: namedtuple | 1859+ Python FAQs | Share
list-vs-tuple | using-yield-in-functions | else | using-map()-for-transformations | zip | thread-safe-data-structures-(queue.queue) | library | type-conversion | lambda | working-with-file-paths | sum-function | implementation | __future__ | fabs-function | time-series-with-pandas | regular-expressions | destructor | threading | list-operation | staticmethod | control-flow | else-statement | join | call | advanced-file-operations | frozenset | memory | indexing | syntax-error | min-function | return-statement | function-argument | sets | scientific-notation | init | input | comprehension | asyncio-module | sorting | assignment-operator | identity-operator | method | generators | filter-function | descriptors | collection | mathematical-function | round-function | version-check | why-use-multiprocessing-over-threading?-(gil) | lambda-function | syntax | data-structures-in-python | functions | precedence-and-associativity | numeric | operator | list-mutation | operators | version | decimal | iterator | expression | introduction-to-python | debugging | data-structures | print-statement | logical-operator | gil | functional-programming | access-modifier | virtual-environment | logical-operation | basic | identifier | function | goto-function | list-join | __all__-attribute | method-overloading | operations | precedence | dictionary | datatype | using-assertions-(assertequal,-assertraises) | software-design | for | inherit | unit-testing | overriding-methods | mathematics | sorted | using-else-and-finally | filter | filtering-and-indexing | reading:-read(),-readline(),-readlines() | reading-and-writing-large-files-efficiently | classes | conditional-statements | indentation | dictionaries | exponentiation | python-django | membership-operators-(in,-not-in) | comparison | range | boolean-masking | list-indexing | list-slicing | dicts | literal-characters-and-special-characters | raise | error-handling | print | string-method | single-inheritance | nested-loop | integer | using-os-and-pathlib-modules | handling-missing-values-(fillna,-dropna) | syntaxerror | tuple | operator-overloading | slicing | matplotlib | format | string-formatting | working-with-binary-files-(rb,-wb) | type-conversion-and-casting | pickling--unpickling | function-and-scope | append | python_version | list-comprehension | constructor | error-handling | python-history | sys-module | namespace | data-type | set | dictionary-methods | complex | comment | while-loop | encoding | id-function | multiple-inheritance | attribute | key-value-pairs | creating-custom-modules | odd-number | mutable | math-copysign | pep | python-repl | match | pandas | joining-and-merging-dataframes | objects | string-methods | generator | deep-copy | string | immutability | statement | working-with-dates-and-times | global-keyword | postfix | while-else-loop | factorial-function | loops | iterators | identity-operator | file_handling | lists | multiprocessing | touples | datetime.date,-datetime.time,-datetime.datetime | map-function | encapsulation | bitwise | directory-operations | operator-or | async | feature | oops | max-min | namedtuple | iterable | stack | random-function | built-in-function | loop | introduction-to-threads | string-iteration | booleans | parameter | multiple-inheritance | multiple-except-blocks | compute | difference-between-threads-and-processes | math | collections | working-with-temporary-files-using-tempfile | list-method | docstring | recursion | built-in-modules | input-function | python | matrix | regular-expression | thread | indexing:-loc-vs-iloc | type_conversion | enumerate() | introduction-to-multiprocessing | copy | boolean-and-non-boolean | thread-synchronization | exception-handling | exception-handling | memory-management | conversion | file-handling | global | zfill-function | immutable-data-type | while-and-for-loop | multithreading | __init_subclass__ | python-module | managing-directories-with-os-and-shutil | assignment-operators | zip-function | min-max-function | set-operation | string-slicing | input-function | center | strings | polymorphism | python-syntax-and-structure | identity-operators-(is,-is-not) | round | def | regex | name-mangling | recurssion | reading-and-writing-files | exception | import-method | class | loop-control | tuples | rollback | python-operators | type-conversion | formatting-with-strftime | using-lists-as-stacks | list-methods-and-slicing | swapping | parsing-with-strptime | defining-functions | logical-operators | counter | assert | dictionary-comprehensions | formal-and-actual-parameter | installation | opening-files-(open()) | string-slicing | floats | heap-memory | oop | class-and-instance-variable | class-and-object | list-comprehensions | control-flow | benefit | binary-operation | application | counter-function | numpy | aggregating-data-with-functools.reduce() | global-variable | list,-set,-and-dictionary-comprehensions | sys | error | generators-in-python | while-loops | quantifiers-(*,-+,-?,-{}) | arbitrary-arguments-(*args,-**kwargs) | logical-operator | sorting-and-ranking | overflow | keyword | inheritance | using-the-threading-module | head-and-tail | loop-control-statements | decorator | pass | invalid-list | floating-point-precision | object-attribute | static-method | typeerror | intering | list | control-statement | tuple-methods | data-structure | sum() | file | lambdas | datetime | slice | class-and-inheritance | using-join()-and-is_alive()-methods | split | random | global-variable | int | variable | bitwise-operator | escape-operator | built-in-function | writing:-write(),-writelines() | boolean | matrix-list-comprehension | update | file-handling | lambda-functions | array | dataframe-and-series-objects | asyncio | pseudocode | higher-order-function | string-manipulation | integers | binary | class-decorators | bitwise-operator | condition | mapping-function | built-in | context-manager | list-comprehension | with-statement | command-line-parsing | creating-and-starting-threads | choice | methods | default-mutable-argument | walking-through-directories-using-os.walk() | data_structure | package-management | mysql | conditional-statement | data-type-conversions | operand | virtual-environment | string-concatenation | functional-programming | anchors-(^,-$) | expand-tab | tuple-unpacking | operator-and | yield | string-method | test-discovery | interpreter | arithmetic-operation | complex-number | turtle | magic-method | default-arguments | data-types | shallow-copy | conditional-statement | data-structure | design-principle | syntax-error | raise-statement | arithmetic-expression | data-type | string-formatting | module ...