Level 1 : How many times will "Hello" be printed in this code?


count = 0
while True:
    print("Hello")
    count += 1
    if count == 4:
        break

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