• JUPYTER
  • FAQ
  • View as Code
  • Python 3 Kernel
  • View on GitHub
  • Execute on Binder
  • Download Notebook
  1. learn-python3
  2. notebooks
  3. beginner
  4. exercises

1. Creating formulas¶

Write the following mathematical formula in Python:

\begin{align} result = 6a^3 - \frac{8b^2 }{4c} + 11 \end{align}
In [ ]:
a = 2
b = 3
c = 2
In [ ]:
# Your formula here:
result = 
In [ ]:
assert result == 50

2. Floating point pitfalls¶

Show that 0.1 + 0.2 == 0.3

In [ ]:
# Your solution here

# This won't work:
# assert 0.1 + 0.2 == 0.3

This website does not host notebooks, it only renders notebooks available on other websites.

Delivered by Fastly, Rendered by OVHcloud

nbviewer GitHub repository.

nbviewer version: 8b013f7

nbconvert version: 7.2.3

Rendered (Tue, 10 Jun 2025 07:09:17 UTC)