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