In [1]:

```
5**2
```

Out[1]:

Note that you should use the `**`

operator. `^`

does something different:

In [2]:

```
5^2
```

Out[2]:

We can of course use $x^{0.5}$ to compute square roots:

In [3]:

```
64**0.5
```

Out[3]:

We can also use the following:

In [4]:

```
import math #has to be in the code before we use math.sqrt
math.sqrt(225)
```

Out[4]:

Now, we are ready to begin writing the code:

In [5]:

```
import math
a = 1
b = 5
c = 2
disc = b**2-4*a*c
if disc > 0:
r1 = (-b + math.sqrt(disc))/(2*a)
r2 = (-b - math.sqrt(disc))/(2*a)
elif disc == 0:
r = (-b + math.sqrt(disc))/(2*a)
else:
print("There are no real solutions")
```