Level 9 : What does the following code print?


t = (1, 2, (3, 4))
print(len(t) + len(t[-1]))

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