Level 2 : What will be the output for the below python program?


num = 7
output = "Greater than 0" if num > 0 else "Smaller than 0"
print(output)

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