🚀 Rocket Launch Game - Float Variables
Let's talk about "numbers with decimals"!
In Python, we use float variables to store numbers that have **decimals**. It's like saying "I have 2.5 toys" instead of just "2 toys". A float is just a number with a dot in the middle, like 3.14 or 1.5.
Example: If the rocket weighs 3.5 tons, you can tell Python: rocket_weight = 3.5
and Python will remember that the rocket's weight is 3 and a half tons!
Now, in this lesson, we will check the rocket's weight. Try to set rocket_weight
to 3.5
in the code below!
Enter Python code:
Console Output:
Console Output:
🚀 Rocket Launch Area:

Click to Reveal Solution
Type as below:
weight = 3.5