Level 1 : What will be the output of the following code?


f =lambda x:bool(x%2)
print(f(20), f(21))

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