Question: Write a function before _ a ( word ) that takes in a string representing a single lowercase English word, and returns the same word
Write a function beforeaword that takes in a string representing a single lowercase English word, and returns the same word but with all letters that come before the first a moved to the end of the string NOT including the a itself Only the location of the first a matters. You can assume there will be at least one a
Submit your code to Gradescope in a file called expy
Examples:
if namemain:
printbeforeatrains #ainstr
printbeforeaattractor #attractor
printbeforeachronophobia #achronophobi
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
