<a href="https://colab.research.google.com/github/MJVelilla/CS488S21/blob/main/python_materials/learn-python3/notebooks/beginner/exercises/numbers_exercise.ipynb" target="_parent"></a>

# 1. Creating formulas
Write the following mathematical formula in Python:

\begin{align}
 result = 6a^3 - \frac{8b^2 }{4c} + 11
\end{align}



```python
a = 2
b = 3
c = 2
```


```python
# Your formula here:
result = (6*(a**3)) - ((8*(b**2))/(4*c)) + 11
```


```python

assert result == 50
```

# 2. Floating point pitfalls
Show that `0.1 + 0.2 == 0.3`


```python
# Your solution here
from decimal import Decimal
str1 = Decimal("0.1")
str2 = Decimal("0.2")
print(str1 + str2)
# This won't work:
#assert 0.1 + 0.2 == 0.3
```

0f9cd3b64fd6c276e337c133b19219adb19b8566
ipynb
Jupyter Notebook
python_materials/learn-python3/notebooks/beginner/exercises/numbers_exercise.ipynb
MJVelilla/CS488S21
5e62570cb1f3e5daa1f65f1cb6d468468f8b035d
MIT
python_materials/learn-python3/notebooks/beginner/exercises/numbers_exercise.ipynb
MJVelilla/CS488S21
5e62570cb1f3e5daa1f65f1cb6d468468f8b035d
MIT
python_materials/learn-python3/notebooks/beginner/exercises/numbers_exercise.ipynb
MJVelilla/CS488S21
5e62570cb1f3e5daa1f65f1cb6d468468f8b035d
MIT
Qwen/Qwen-72B
1. YES
2. YES