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