New to Python (learning functions)

Hi Lily, and welcome!

Three things you are doing wrong:

(1) Unless you use Photoshop to write your code, you should not post screenshots of code. Copy and paste it as text, between code fences, as described here:

Screen shots make it difficult for us to run your code if we need to, and discriminate against the blind and visually impaired who may be using a screen reader. (Yes, blind programmers exist.)

(2) Don’t make us guess what error you get. Its not always obvious or easy to guess. Copy and paste the entire traceback, if you get one, starting with the line “Traceback…” not just the last error message at the end.

(3) Tell us what result you expected, and what result you got instead.

In this case, I think I can probaby guess what error you are getting. It looks like you are doing this:

radius = float

and then you will probably get an error similar to:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for *: 'type' and 'float'

Am I close?

Look at the value of your radius: you set it to float. What value do you expect it to have?

float is a type or class in Python, that is, it tells you what type of thing a value is. Values can be strings, integers (whole numbers), lists, floats, or many others.

Try setting radius = 5.2 instead, for example.

3 Likes