Question: write the code in python please! i think i have the first figured out (code at bottom). i cant figure out the silly_strings, any help

write the code in python please! i think i have the first figured out (code at bottom). i cant figure out the silly_strings, any help is appreciated!!! i will upvote it works!  write the code in python please! i think i have the
first figured out (code at bottom). i cant figure out the silly_strings,
any help is appreciated!!! i will upvote it works! Write a function

Write a function called reverse_alternate_words(input_string) that takes in a string and returns a new string where every other word is reversed. For the purposes of this exercise, a word is defined as a sequence of non-space characters. Examples: reverse_alternate_words("This is a test string") returns "sihT is a test gnirts" reverse_alternate_words("I love programming in python") returns "I love gnimmargorp in nohtyp" reverse_alternate_words("I'm a master problem solver") returns "m'l a retsam problem revlos" 2. Ted the TA doesn't know what lists are. He thinks they were just strings with commas in them like "T,E,D,i,S,S,I,L,L,Y" instead of ["Ted",'Is,"'Silly"]. Each new word alternates between uppercase and lowercase letters. Now, this is just plain silly. Help Ted out and make a function called silly_strings(string) that takes in one of Ted's silly strings, finds all the words, capitalizes them, and adds them into a list. Examples: silly_strings("T,E,D,i,s,S,I,L,L,Y") returns ['Ted','Is','Silly'] silly_strings("M,Y,t,a,s, A, R, E, r,e, a, I,I,y,A,W,E,S, C returns ['My', 'Tas', 'Are', 'Really', 'Awesome'] silly_strings("I,I,i, k,e,F,O,U,N,T,A,I,N,d,i,n,i,n,g,H returns ['I', 'Like', 'Fountain', 'Dining', 'Hall'] 3. Test each function by creating a test function that uses if statements to compare expected and actual results. Each test function should have 2 test cases. Call the test functions in main() to receive full credit (this means you need to indent!)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!