Week 0

Einstein

A formula that turns a mass into an energy.

You type

A mass, as a number.

The tool
A number goes in and a number comes out A mass The formula An energy
What comes out

One energy number.

The question, more slowly

The question is: ask for a mass and print the energy from E = mc². The speed of light in the formula is the large constant the spec uses. The person types a number. You do the multiplication and print the result.

Input gives you text. The formula needs a number. Convert, multiply, print. With a mass of 1 you can check the arithmetic on paper, because the answer is just the constant squared.

People square the mass instead of the constant, or they forget to convert the text and Python refuses to multiply. The spec also says how the prompt should read.

Before you code

Pick a mass of 1 and do the arithmetic on paper before you ask Python to do it.