Level 1 : What will the following code output?


t = (1, 2, 3, 4)
x, *y, z = t
print(x, y, z)

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