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