Variables and Data Types


#1

variable_name = my_name
name = "obi"
age = "12"
hungry = true

What am i doing wrong? i followed everything to the example


#2

Which exercise was that?


#3

Introduction to RUby : Variables and Data Types


#4

I suppose you're talking about the exercise 2/16 Data Types: Numbers, Strings, Booleans?


#5

hello mate!I think he is talking about introduction(number 13) variables and data types.I am stuck there as well.


#6

Well the problem his code has for this exercise is that he used quotes for his age variable and didn't call it my_age.

The exercise also didn't require a boolean.

Also, he's assigning my_name to variable_name even though my_name wasn't declared beforehand, so he will get an error from Ruby.


#7

I know what you have to do:
variable_name = my_name = "Obi"
variable_age = my_age = 12


#8

Here is what you're doing wrong

In ruby you don't put down the word var or variable. Plus you don't need a string for 12 this is the code you would need

my_name = "obi"
my_age = 12
hungry = true

sorry if I didn't explain this very well, I'm new to ruby myself