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