-
Notifications
You must be signed in to change notification settings - Fork 1
Checking naming convention #4
Copy link
Copy link
Open
Description
- What you did - There is code and I need your help to review the naming conventions
- Why/How you did. - other than defining the function name , I have defined rest lines of code.
- What is problem. - just want to know if there is anything that can be still corrected
- What you already tried - just gave some obvious names to variables
ignore the predefined first line of below code # def master_yoda(text):
problem statement: MASTER YODA: Given a sentence, return a sentence with the words reversed
master_yoda('I am home') --> 'home am I'
master_yoda('We are ready') --> 'ready are We'
def master_yoda(text):
split_input= text.split()
#print(split_input)
inverse_input = split_input[::-1]
#print(inverse_input)
join_output = " ".join(inverse_input)
#print(join_output)
return join_output
# Check
master_yoda('I am home')
'home am I'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels