2 Variables


#1

Tried to get this... Don't know what I'm doing wrong !!!!
These are the instructions:
Set the variable my_variable equal to the value 10.
Click the Save & Submit button to run your code.

This is what I have:
def class my_variable =10

This is the error message:
Oops, try again. Did you remember to create a variable called my_variable?


#2

Hi @landen_lewis ,

The phrase def class needs to be removed. def is used to begin the header of a function definition, and class is used to begin the definition of a class. To perform the assignment requested by the instructions, all you need is ...

my_variable = 10

#3

THANKS! I programmed with "BASIC" in 1984- been "moron" using windows and mouse too long; syntax and variable definition seem like Greek now! thanks for post!

john


#4

Yes, @appylpye is correct. In this case, you would not need to define the variable.

my_variable = 10

This should do the trick


#5

A post was split to a new topic: Variables


#6