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