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