Question: Write a function combine ( s 1 , s 2 , n ) that takes as inputs two strings s 1 and s 2 and
Write a function combines s that takes as inputs two strings and and an integer and
that returns a new string in which the first characters of are followed by the last characters of
For example:result: 'compence'
combinepython 'code',
result: 'pyde'
If either string s or s does not have at least characters, you should use all of its characters:result: 'yougram'result: 'afterfun'
Write a function reverselastvals that takes as inputs a list vals and an integer and that
constructs and returns a new list in which the last values of vals are reversed and all other values from
vals remain in their original positions. For example:
reverselast
result: # reversed the last values
reverselast
result: # reversed the last valuesresult: # reversed the last values
If is greater than or equal to the length of vals, the entire list should be reversed:result: quad# so reversed entire list
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
