Create a new string made of the first, middle, and last characters of each input string using python programming
belongs to collection: Python String Exercises
All Answers
total answers (1)
belongs to collection: Python String Exercises
total answers (1)
Hint:
len(s1)to get the string length.Solution:
- Get the first character from both strings, concatenate them, and store them in variable
- Get the middle character from both strings, concatenate them, and store them in variable
- Get the last character from both strings, concatenate them, and store them in variable x
- In the end, join
- print the
need an explanation for this answer? contact us directly to get an explanation for this answerxyx,y, andzand save it in the resultvariableresult