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


string = "my name is x"
for i in ' '.join(string.split()):
    print (i, end=", ")

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