Level 5 : What will be the output of the following code?


x = "abcdef"

i = "i"

while i in x:

    print(i, end=" ")

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