Level 5 : What is the purpose of the if statement in Python?

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