Skip to main content
Fixed typo
Source Link
Joao-3
  • 1.4k
  • 4
  • 18

Python 3Python 3, 3939 38 bytes

lambda s:''(j:=''.join)(map(''.joinj,zip(s,s)))

Try it online!Try it online!

Explanation:

lambda s:                               # define a lambdafunction which takes a string sand...
                             zip(s,s)   # zips sit with itself...,
                      map(''.joinj,        )  # joins each tuple...,
         ''(j:=''.join)(                     ) # and joins theeach resultstring together.

Python 3, 39 bytes

lambda s:''.join(map(''.join,zip(s,s)))

Try it online!

Explanation:

lambda s:                               # define a lambda which takes a string s...
                             zip(s,s)   # zips s with itself...
                 map(''.join,        )  # joins each tuple...
         ''.join(                     ) # and joins the result together.

Python 3, 39 38 bytes

lambda s:(j:=''.join)(map(j,zip(s,s)))

Try it online!

Explanation:

lambda s:                              # a function which takes a string and...
                            zip(s,s)   # zips it with itself,
                      map(j,        )  # joins each tuple,
         (j:=''.join)(               ) # and joins each string together.
Source Link
Joao-3
  • 1.4k
  • 4
  • 18

Python 3, 39 bytes

lambda s:''.join(map(''.join,zip(s,s)))

Try it online!

Explanation:

lambda s:                               # define a lambda which takes a string s...
                             zip(s,s)   # zips s with itself...
                 map(''.join,        )  # joins each tuple...
         ''.join(                     ) # and joins the result together.