Post History
Python 3, 82 81 bytes lambda a,b:[a[:i]+b for i in range(len(a)+2)if i>len(a)or b[:len(a)-i]==a[i:]][0] Try it online!
Answer
#2: Post edited
# [Python 3], 82 bytes- <!-- language-all: lang-python -->
lambda a,b:[a[:i]+b for i in range(len(a)+1)if i==len(a)or b[:len(a)-i]==a[i:]][0][Try it online!][TIO-ks7a4mqb]- [Python 3]: https://docs.python.org/3/
[TIO-ks7a4mqb]: https://tio.run/##bY7BDoIwEETP@hUbL7WhJiK3JjUBFfUbag8lFt0EKkEO@vXYghA17mnnzWx2qmdzvdmozcWpLXSZnTVolnGpJUcVZJDfakBAC7W2FzMvjJ1rGoQUc0AheukimeT9vkAlhJbIlZJL1ZqHLqvC3IWUJE42211KGJBduj8ciWKOdeNZ/J4eJxvPwlXUyc7314O5HchoE6Wmf7oO/ynl00lVo21GJNE3DGYMZsEnCx2DxdrR/CfL4DtHafsC "Python 3 – Try It Online"
- # [Python 3], <del>82</del> 81 bytes
- <!-- language-all: lang-python -->
- lambda a,b:[a[:i]+b for i in range(len(a)+2)if i>len(a)or b[:len(a)-i]==a[i:]][0]
- [Try it online!][TIO-kssqqu83]
- [Python 3]: https://docs.python.org/3/
- [TIO-kssqqu83]: https://tio.run/##bY7NDoIwEITP8hQbLrWhJqK3JjXxD/UZag8ltroJFoIc9OmxBTFq3NPON7PZqR7NpXTz1opjW@hrftKgWc6llhxVkoMta0BAB7V2ZzMujBtrmswoWsBFr3wil7zfJ6iE0BK5UnKqWnPX16owNyElWa7Wm21GGJBtttsfiGKedRPY8jU9Xq0DS2fzTnZ@uB7MzUDeNlEq@lN1@E8pj0ZVja55I4mhYRIziJNPlnoGk4Wn9ifL4DtHafsE "Python 3 – Try It Online"
#1: Initial revision
# [Python 3], 82 bytes <!-- language-all: lang-python --> lambda a,b:[a[:i]+b for i in range(len(a)+1)if i==len(a)or b[:len(a)-i]==a[i:]][0] [Try it online!][TIO-ks7a4mqb] [Python 3]: https://docs.python.org/3/ [TIO-ks7a4mqb]: https://tio.run/##bY7BDoIwEETP@hUbL7WhJiK3JjUBFfUbag8lFt0EKkEO@vXYghA17mnnzWx2qmdzvdmozcWpLXSZnTVolnGpJUcVZJDfakBAC7W2FzMvjJ1rGoQUc0AheukimeT9vkAlhJbIlZJL1ZqHLqvC3IWUJE42211KGJBduj8ciWKOdeNZ/J4eJxvPwlXUyc7314O5HchoE6Wmf7oO/ynl00lVo21GJNE3DGYMZsEnCx2DxdrR/CfL4DtHafsC "Python 3 – Try It Online"