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