1.3 Booleans - What am I doing wrong?


#1

Here is what I have for this exercise:

Variable = my_int
Variable = my_float
Variable = my_bool
my_int = 7
my_float = 1.23
my_bool = True

I am getting the following error message:

Oops, try again.
Did you define a variable called my_int?

Can someone assist me?

`


#2

What do you need these for?


#3

I thought I need to define what the variables are. I'm assuming that's incorrect? (I'm new to this and trying to learn)


#4

This is enough. You don't need to "initiate" variables like Variable = my_int in python.


#5

@datfatcat - why don't I need to define the variables in this execrise?


#6

You did define them?

my_int = 7
my_float = 1.23
my_bool = True

Are they not defined? Python recognizes that these are variables. You don't need to tell Python that they are variables by doing Variable = my_int.


#7

Understood. Thanks for the explanation! I appreciate it


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.