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


num = 10

if num > 0:
    print("Positive number")
elif num == 0:
    print("Zero")
else:
    print("Negative number")

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