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