Help me in solving PSPP82 problem

My issue

def greet(name):
return f"Hello,{name}!"

def capitalize(text):
return text.upper()

def greet_and_capitalize(name):
# Update the code below this line
return capitalize(greet(name))

Call the functions

name = “Alice”
final_result = greet_and_capitalize(name)

Display the results

print(“Greeting:”,greet(name))
print(“Capitalized Greeting:”,capitalize(greet(name)))
print(“Final Result:”,final_result)

My code

def greet(name):
    return f"Hello,{name}!"

def capitalize(text):
    return text.upper()

def greet_and_capitalize(name):
    # Update the code below this line
    return capitalize(greet(name))
    
    




# Call the functions
name = "Alice"
final_result = greet_and_capitalize(name)


# Display the results
print("Greeting:",greet(name))
print("Capitalized Greeting:",capitalize(greet(name)))
print("Final Result:",final_result)

Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone

It looks like you’ve made the necessary changes to the greet_and_capitalize function, but there is an issue in the way you are printing the results. Here’s your corrected code:

def greet(name):
return f"Hello, {name}!"

def capitalize(text):
return text.upper()

def greet_and_capitalize(name):
return capitalize(greet(name))

Call the functions

name = “Alice”
final_result = greet_and_capitalize(name)

Display the results

print(“Greeting:”, greet(name))
print(“Capitalized Greeting:”, capitalize(greet(name)))
print(“Final Result:”, final_result)

The main change is adding a space after the comma in the greet function to format the greeting properly. Additionally, I removed extra whitespace at the end of the greet_and_capitalize function. With these corrections, your code should work as expected.