Level 1 : What is output of the following code?


x = 100
y = 50
print(x and y)

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