Could someone write both programs in python. Please DO NOT use print(). Please use return().
. def simple_pig latin(input, sep-" ", end.": Accept a string input, which might include multiple words separated by a separator sep and perform the following steps: more characters Find the list of "words" (Note: "words" are just "zero or symbol". So, depending on the separator or 'a..b' could be a "word"). Inspect every "word" and apply the following conversions: o o if the word starts with a non-letter or contains no characters, do nothing to it if the word starts with a vowel, add 'way' to the end if the word starts with a consonant, place the first letter at the end and add 'ay - Reassemble the words back into one string and return it, making sure a single sep is padded between any two neighboring words and the final string ends with end. o o Assume: the input does not have any capital letters o Go ahead and use string methods like .join(), split) o simple_ pig latin("i like this") o simple_pig_latin("1 iike this", sepe',') . like thisway,' o simple pig latin("i-like-this, o simple_pig latin("i.like.this",sep. ,end')- iway.ikelay.histay! iway ikelay histay # default sep(space) and end(dot) # separator is dot, so 'hole thing is a single "word" # sep is '-' and default end(dot) #sep is and end is .!' iway-ikelay-histay. o simple pig latin(".") # only word is , so do nothing to it and add a to the end def replace(xs,old, new, limit-None): Given a list xs, replace occurrences of old value with new value. An optional fourth argument limit is an integer states the maximum number of replacements allowed. You should only replace up to the first limit occurrences of old and leave the rest unchanged. When limitNone, there's truly no limit (and we replace all occurrences ofold). Negative or zero limit: no replacement o o Examples: Assume: xs is a list; xs could be empty. Return None, because the replacement happened in-place. o >>> xs [1,2,1,3,1,4,1,5,1] >>> replace(xs,1,-1) >>> Xs #returns None t-1, 2, -1, 3, -1, 4, -1, 5, -1] #replace all o > xs [1,2,1,3,1,4,1,5,1] >> replace(xs,1,-1,2) >>> XS #replace only the first 2 occurrences >>> xs = [1,2,1,3,1,4,1,5,1] >>> replace(xs,1,-1,-100) >>> xs replace none