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