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 | 1736+ Python FAQs | Share
name-mangling | sys | syntax-error | factorial-function | python-repl | random | input | turtle | list-comprehension | arithmetic-operation | inheritance | scientific-notation | string-method | shallow-copy | goto-function | raise | debugging | method | asyncio-module | pep | datetime | type_conversion | format | file-handling | higher-order-function | exception | syntax | with-statement | regular-expression | recurssion | data-structure | error | identifier | math | lambda | list-comprehension | arithmetic-expression | escape-operator | while-else-loop | swapping | multithreading | library | destructor | sorted | version | class | file | pickling-&-unpickling | attribute | staticmethod | math-copysign | choice | operator | control-flow | regex | operators | class-and-object | sum() | inherit | floating-point-precision | complex-number | string-manipulation | print-statement | control-statement | collection | input-function | dictionaries | installation | function-argument | immutable-data-type | join | assert | operator-overloading | string | iterable | precedence-and-associativity | split | while-loop | global-keyword | virtual-environment | for | enumerate() | numpy | loops | complex | file_handling | decimal | lambdas | list-join | id-function | bitwise-operator | exponentiation | logical-operator | heap-memory | range | assignment-operator | expression | design-principle | filter-function | data-type | python_version | zip | update | sorting | formal-and-actual-parameter | matplotlib | list-slicing | version-check | default-mutable-argument | indentation | async | generators-in-python | binary | overflow | function-and-scope | syntaxerror | encoding | logical-operator | indexing | python | interpreter | mapping-function | __all__-attribute | list-vs-tuple | zip-function | counter | sys-module | list-operation | operator-or | binary-operation | identity-operator | condition | rollback | __init_subclass__ | list-indexing | slicing | generator | typeerror | asyncio | mathematics | multiprocessing | loop | file-handling | global | docstring | call | function | conditional-statement | touples | string-concatenation | zfill-function | polymorphism | data-structure | map-function | nested-loop | frozenset | match | classes | statement | type-conversion | keyword | precedence | loop-control | operations | comparison | else-statement | filter | string-method | tuple-unpacking | access-modifier | list-method | min-function | conditional-statement | oop | expand-tab | list-mutation | invalid-list | variable | control-flow | memory | yield | integer | conversion | magic-method | identity-operator | memory-management | static-method | matrix-list-comprehension | odd-number | boolean | input-function | print | import-method | center | lists | command-line-parsing | python-module | global-variable | int | methods | built-in-function | head-and-tail | array | mysql | data_structure | collections | pseudocode | python-django | namespace | round-function | objects | set-operation | object-attribute | decorator | python-history | functional-programming | string-formatting | numeric | oops | tuple | copy | class-and-instance-variable | recursion | descriptors | while-and-for-loop | built-in | encapsulation | deep-copy | feature | counter-function | global-variable | implementation | syntax-error | module | operand | append | dictionary | exception-handling | application | init | slice | random-function | package-management | logical-operation | parameter | set | thread | min-max-function | immutability | datatype | def | generators | round | type-conversion | dicts | matrix | string-slicing | __future__ | compute | postfix | comprehension | string-formatting | virtual-environment | constructor | list | string-slicing | fabs-function | bitwise | bitwise-operator | max-min | return-statement | gil | namedtuple | stack | software-design | mathematical-function | boolean-and-non-boolean | error-handling | mutable | string-iteration | iterator | data-type | operator-and | class-and-inheritance | functions | comment | pandas | built-in-function | context-manager | sum-function | basic | lambda-function | exception-handling | multiple-inheritance | threading | benefit | data-structures ...