Level 1 : What is the output of following code?


r = lambda q: q * 2
s = lambda q: q * 3
x = 2
x = r(x)
x = s(x)
x = r(x)
print (x)

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