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