# Module 5.3 step 11

I am repeating the same steps I use in Module 5.3 step 10 which give me the correct answer but keep getting the wrong answer in step 11. Please help! This is the code I use in the previous step:

# TODO: create a function called calculate_diameter that returns the diameter given a circumference

def calculate_diameter(circumference):
pi = 3.14
calculate_diameter = circumference / pi
return calculate_diameter

# TODO: get the circumference from the user

user_input = int(input(“Enter the circumference:”))

# TODO: call the calculate_diameter function with the user’s input and print its result

print(calculate_diameter(user_input))

Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
Enter the circumference: 22
7.006369426751592

It looks pretty close. Possibly it’s just that rather than using “calculate_diameter = circumference / pi”, they expect you to say “diameter = circumference / pi”, and then to return that variable. “calculate_diameter” is really the name of the function, more than a local variable.

Thanks, I will give it a try and see if it works.

It works!

diameter = circumference / pi
return = diameter

1 Like