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