Question: I have tried everything and my code seems to be very close but i keep getting a name error when i have defined the variable. 

```
from math import *

class Spheres:
    def __init__(self, radius):
        self.radius = r
        self.area = 0
        self.volume = 0

    def getRadius(self):
        return self.radius

    def surfaceArea(self):
        self.area = 4 * 3.14 * (r*r)
        return (self.area)

    def getVolume(self):
        self.volume = (4/3) * 3.14 * (r * r * r)
        return (self.volume)

def main():
    r = input("Enter the radius of the sphere: ")
    s = Spheres(r)
    print("The volume of the sphere is: ", s.surfaceArea())
    print("The surface area of the sphere is: ", s.volume())

if __name__ == '__main__':
    main()

```

The error message I get is:

```
Traceback (most recent call last): 
  File "/local/files/jfult001/CSC221/lab10/9ball.py", line 30, in <module> main() 
  File "/local/files/jfult001/CSC221/lab10/9ball.py", line 26, in main print("The volume of the sphere is: ", s.surfaceArea()) 
  File "/local/files/jfult001/CSC221/lab10/9ball.py", line 15, in surfaceArea self.area = 4 * 3.14 * (r*r) 
NameError: global name 'r' is not defined 

```

Answer: 
```
def surfaceArea(self):
    self.area = 4 * 3.14 * (r*r)
    return (self.area)

def getVolume(self):
    self.volume = (4/3) * 3.14 * (r * r * r)
    return (self.volume)

```

In functions above change all r's to `self.radius` cause `self.radius` is the corresponding attribute of your class not r ...

also there are some minor mistakes in your `__init__`, correct your class as follows:

```
class Spheres:
    def __init__(self, r):
        self.radius = r
        self.area = 0
        self.volume = 0

    def getRadius(self):
        return self.radius

    def surfaceArea(self):
        r=self.radius
        self.area = 4 * 3.14 * (r*r)
        return (self.area)

    def getVolume(self):
        r=self.radius
        self.volume = (4/3) * 3.14 * (r * r * r)
        return (self.volume)

```
It looks like 'r' is input as a string.

I would write r=float(input("Enter radius:"))