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