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