Does my variable name need to match the math I’m doing?

Question

Most of the variable names in these exercises match the math being done in the value they’re assigned.

Answer

Your variable can be named anything you like! You could name a variable addition and then set its value as the addition of two numbers, or you could just as easily name it twoNumbers.

However, it’s definitely helpful to anyone reading your code (including you) if you name your variables in a way that is unambiguous and descriptive. For example, naming a variable x may be short and sweet, but it tells me absolutely nothing about the value it holds or what it’s meant for. If we have a variable named degrees_celsius, it seems likely that it would hold some number that is the temperature in celsius. Much better!

10 Likes

ben katsayısı = 40/8 yaptım ancak çalışmadı ve karşıma şu çıktı Adlı bir değişken oluşturdunuz product mu?
ne yapmalıyım?

Hi - I did this but still returning error

product = 10 * 2
Print “prodcut”

1 Like

You have to print the variable name. You’re printing a string.

Try it without the quotes

Your variable that you put in print doesn’t match your variable name when defined. You misspelled product.