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