# 5.3 step 16 -Shape and Size

did not actually understand what is the question. So we have defined a function in the previous section as follows
def calculate_diameter(circumference):
** pi = 3.14**
** diameter = circumference/pi**
** return diameter**

user_input = int(input (“what is the circumference?”))
print(calculate_diameter(user_input))

this worked perfectly!!.

But in question 16 asked to get the same function and remove the last two lines, but define a function to get the area using radius. So I rewrote the new function as

** pi = 3.14**
** return area**

but now what should we do? What is the question? As soon as I hit the run code two lines below with 5 and 78.5 appears . then I hit the submitt button…

what I am doing wrong?? and what is the question?

The same code is running well in Jypyter notebook.

HELP HELP

I just tried your code. There is definitely a glitch in Stepik. If you have an ability to report it, you should. (I am not logged in there, so I don’t see an option for that).

With that said, let’s find a workaround. I can suggest two approaches:

1. In formulas, what do we use to group operations, to improve readability and remove possible ambiguity?

2. Or, alternatively, seeing how you multiply a number by itself, what other math operation can you use in your formula instead? Finally it worked…There is nothing wring with the code.

I just tweeted and it worked!!

This doesn’t look right. You probably meant `pi` instead of the `2` in your formulas. Essentially, you must’ve rearranged the multipliers, right?

The two options I was suggesting above were to group the two `radius` multipliers with parentheses or to replace the `radius * radius` multiplication by squaring it.

This is a precision error. You can replicate it by running the different arrangements of the formula on repl.it using a floating point radius and displaying a large number of digits after the decimal point.

Thanks!!!

Yes, I tried to write in other ways…but did not work except the way I wrote here.

Anything that prioritizes squaring the radius first should probably work equally well.

I’m wondering if this thread is seen by LaunchCode / Stepik curriculum people. This shouldn’t be happening in a course/test for beginners. No wonder the success rate on that question is only 27%.

The code looks good for the function. Did your input syntax match the function? It may be just a question of putting things a certain way to be graded.

As an exercise, I tried this:

``````pi = 3.14
``````81.32969911593599476873350795358419418334960937500000