Study Guide

7.6.4 Enthusiasm CodeHS Answers

7.6.4 Enthusiasm CodeHS Answers

The most common answer is:

string = "codehs rocks"

def add_enthusiasm(string):
    string = string.upper()
    return string + "!"

print(add_enthusiasm(string))

This code defines a function add_enthusiasm that takes a string, capitalizes it using the .upper() method, appends an exclamation point, and then returns the modified string. The print statement calls this function with "codehs rocks" as the input.