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


for i in range(float('inf')):
    print (i)

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