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