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