1. Prompt the user for a name 2. Call a function that can accept the name that the user entered.3. In the function, reverse the name and return the new value to the function call.4. Output to the console "Hi <username>, do you mind if I call you <reversed user name>"? (replace <username> and <reversed user name> with the proper values).
I WROTE THE CODE IN PYTHON LANGUAGE
CODE:
def reverse_name(name):
return name[::-1] #string slicing convert into reverse
name=input("Enter name: ") #input scan user name.
reversename=reverse_name(name) #calling reverse_name()
function.
print("reverse name: ",reversename)
OUTPUT:
SCREENSHOT OF THE CODE:
Get Answers For Free
Most questions answered within 1 hours.