Level 8 : What will be the output of the following Python program?


x = 'abcd'
for i in range(len(x)):
    print(i)

Author: HareramG | Tags: loop | 1736+ Python FAQs | Share
identity-operator | mapping-function | function | while-loop | generators | name-mangling | indentation | encapsulation | generator | function-and-scope | fabs-function | file | def | file-handling | comprehension | string-manipulation | dictionaries | exception-handling | while-else-loop | async | feature | class-and-inheritance | polymorphism | default-mutable-argument | function-argument | scientific-notation | debugging | else-statement | classes | python-django | control-flow | operators | oops | operator | bitwise-operator | filter-function | loop-control | formal-and-actual-parameter | math-copysign | loop | magic-method | boolean | datatype | loops | built-in | dictionary | syntax-error | escape-operator | yield | sorting | data-type | version | counter-function | indexing | logical-operator | assert | error | recursion | overflow | match | lists | asyncio-module | __future__ | namedtuple | turtle | max-min | with-statement | installation | objects | built-in-function | input | functions | precedence-and-associativity | print | destructor | python_version | exception | sys | benefit | exponentiation | command-line-parsing | global-variable | boolean-and-non-boolean | encoding | string | tuple | implementation | for | asyncio | print-statement | odd-number | list-comprehension | collection | python | attribute | min-function | string-concatenation | docstring | type_conversion | iterator | zip-function | regex | list-join | arithmetic-operation | head-and-tail | heap-memory | integer | round | decorator | zfill-function | operator-overloading | sys-module | statement | mutable | memory-management | id-function | data-type | multiple-inheritance | application | binary-operation | inherit | datetime | global-keyword | filter | sum() | python-module | control-flow | object-attribute | software-design | list-method | deep-copy | error-handling | update | return-statement | string-iteration | python-repl | iterable | complex | touples | multithreading | center | comment | list-mutation | conditional-statement | random-function | identifier | pickling-&-unpickling | package-management | set | round-function | constructor | identity-operator | immutability | input-function | map-function | immutable-data-type | version-check | expand-tab | range | expression | functional-programming | complex-number | type-conversion | binary | built-in-function | global-variable | pandas | tuple-unpacking | list-slicing | format | operand | __all__-attribute | comparison | methods | matrix-list-comprehension | int | bitwise | init | keyword | pep | list | dicts | assignment-operator | floating-point-precision | compute | string-slicing | namespace | variable | import-method | class-and-instance-variable | thread | sorted | operator-and | numpy | design-principle | arithmetic-expression | conversion | stack | bitwise-operator | input-function | nested-loop | lambda | syntax | threading | call | split | interpreter | global | precedence | counter | math | memory | python-history | static-method | recurssion | condition | data-structure | multiprocessing | while-and-for-loop | data-structures | descriptors | file-handling | basic | logical-operation | rollback | data-structure | data_structure | parameter | regular-expression | enumerate() | goto-function | file_handling | matplotlib | zip | virtual-environment | exception-handling | method | virtual-environment | mathematical-function | postfix | min-max-function | random | lambda-function | conditional-statement | inheritance | list-comprehension | slicing | mathematics | pseudocode | gil | join | factorial-function | mysql | higher-order-function | array | choice | frozenset | module | operator-or | string-slicing | class-and-object | decimal | lambdas | staticmethod | typeerror | access-modifier | control-statement | list-operation | invalid-list | swapping | append | string-formatting | logical-operator | oop | class | syntaxerror | raise | copy | list-indexing | operations | matrix | context-manager | string-method | slice | library | string-method | syntax-error | set-operation | numeric | list-vs-tuple | shallow-copy | __init_subclass__ | collections | string-formatting | type-conversion | sum-function | generators-in-python ...