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