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