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