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