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


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

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