Level 10 : What will be the output of the following Python code?


x = "abcdef"
i = "i"
while i in x:
    print(i, end=" ")

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