Previously, you've learned about storing floats in variables, working with Booleans, and using comparison operators to check relationships between values.
Let's practice combining these concepts to build your confidence!
Engagement Message
Ready to show what you've learned?
Type
Multiple Choice
Practice Question
Which of the following correctly assigns a floating-point number to a variable and then checks if it's greater than 10?
A. price = "15.99"; result = price > 10 B. price = 15.99; result = price > 10 C. price = 15.99; result = price == 10 D. price = 15,99; result = price > 10
Suggested Answers
- A
- B - Correct
- C
- D
Type
Sort Into Boxes
Practice Question
Sort these values into the correct data type categories:
Labels
- First Box Label: Float
- Second Box Label: Boolean
First Box Items
- 3.14
- 9.99
- 0.0
Second Box Items
- True
- False
Type
Fill In The Blanks
Markdown With Blanks
Let's practice creating and comparing variables. Fill in the blanks to create a temperature variable and check if it's below freezing (32.0 degrees):
Suggested Answers
