Aan de slagGa gratis aan de slag

Creating a float

Before we start looking for Bayes' kidnapper, we need to fill out a Missing Puppy Report with details of the case. Each piece of information will be stored as a variable.

We define a variable using an equals sign (=). For instance, we would define the variable height:

height = 24

In this exercise, we'll be defining bayes_age to be 4.0 months old. The data type for this variable will be float, meaning that it is a number.

Deze oefening maakt deel uit van de cursus

Introduction to Data Science in Python

Cursus bekijken

Oefeninstructies

  • Define a variable called bayes_age and set it equal to 4.0.
  • Display the variable bayes_age.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Fill in Bayes' age (4.0)
____

# Display the variable bayes_age
____(____)
Code bewerken en uitvoeren