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