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