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