Level 9 : What will be the output of the following Python code?


if (9 < 0) and (0 < -9):
    print("hello")
elif (9 > 0) or False:
    print("good")
else:
    print("bad")

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