Ruby Ruby Basics Numbers Math Operations

Saadia Fattah
Saadia Fattah
1,939 Points

I don't understand why it's wrong.

Bummer: (eval):1: syntax error, unexpected '=', expecting end-of-input 25 * 3 = 75 ^

program.rb
25 * 3 = 75
product = 75
7 \ 4.0 = 1.75
qoutient = 1.75

2 Answers

Rogier Nitschelm
Rogier Nitschelm
iOS Development Techdegree Student 5,460 Points

Hello there,

The =-operator is used to assign a value to a variable. Like so:

count = 75 # stores the number 75 in a variable named count

The ==-operator is used for comparison. Like so:

25 * 3 == 75 # true

You cannot use = for comparison of two values.

25 * 3 = 75 # invalid, you are trying to assign 75 to the expression 25 * 3. 
25 * 3 == 75  # valid, you are comparing 25 * 3 with 75. Which are equal