Level 1 : What will be the output of the following Python program?


x = 'abcd'
for i in range(len(x)):
    print(i)

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