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