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