+ 3
[CHALLENGE] See if the End Of The String Matches The Start Of The Second String
Write a function that takes two strings and checks if the last 4 letters of the first string matches the first 4 letters of the second string. Examples: CheckString("Hello", "ello") Challenge inspired by: https://edabit.com/challenge/H9ohpGMyqJ9bAkqE5
7 Answers
+ 5
chkstring=lambda a,b:a[-4:]==b[:4]
+ 2
Hey, RuthlessDust! Thank you for the challenge! Here is my small piece of a code (please see comment for correct input format before RUNNING the code):
(Python 3) https://code.sololearn.com/cxec27Wlhe8a/#py
Lambda alternative included in the comments
0
https://code.sololearn.com/cPh6jJZQP41s/?ref=app
0
@hinanawi your code doesn't work. If you input hello and gdro, it outputs matches
0
@Tiger Jones my bad, forgot to put the break in. should work now