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