Level 10 : What is the output of the following code?


str = 'surya'
for i in range(len(str)):
    print(i)

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