Level 10 : What will be the output of the following Python code?


for i in range(int(2.0)):
    print(i)

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