Skip to content

Checking naming convention #4

@vandanagarg

Description

@vandanagarg
  • 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'

@peeyushsingla

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions