Level 1 : What will be the output of the following Python code?


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

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