Level 10 : What is the output of the following code?


y = 10
x = y += 2
print(x)

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