# Error Ruby Code

**URL:** <https://www.ruby-forum.com/t/error-ruby-code/189690>\
**Category:** Rails\
**Created:** [June 5, 2010, 11:25am UTC](https://www.ruby-forum.com/t/error-ruby-code/189690 "2010-06-05T11:25:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srinivas\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@Srinivas\_G](https://www.ruby-forum.com/u/Srinivas_G)\
**Post date:** [June 5, 2010, 11:25am UTC](https://www.ruby-forum.com/t/error-ruby-code/189690/1 "2010-06-05T11:25:12Z")

</div>

Explain the error in the following sample of Ruby code. Reference the  
line which the error is found on:

1- my\_grade = “A+”  
2-  
3- if my\_grade = “A+”  
4- puts “PASSED!!!”  
5- end

---

<div class="post-metadata">

**Author:** ![Srinivas\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@Srinivas\_G](https://www.ruby-forum.com/u/Srinivas_G)\
**Post date:** [June 5, 2010, 12:05pm UTC](https://www.ruby-forum.com/t/error-ruby-code/189690/2 "2010-06-05T12:05:35Z")

</div>

On Jun 5, 10:24 am, Srinivas G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Explain the error in the following sample of Ruby code. Reference the  
> line which the error is found on:

Please do your homework yourself rather than sending countless emails  
to the list with each of your assignments.

Fred

---

<div class="post-metadata">

**Author:** ![Srinivas\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/48db29/32.png) [@Srinivas\_G](https://www.ruby-forum.com/u/Srinivas_G)\
**Post date:** [June 5, 2010, 1:12pm UTC](https://www.ruby-forum.com/t/error-ruby-code/189690/3 "2010-06-05T13:12:19Z")

</div>

The obvious error is that if we do your work for you, you learn nothing.

Are you even _trying_ to solve these? How are you studying Ruby to be  
posed  
these problems? If you’ve got classes then I’d suggest paying more  
attention  
in them; if you’re studying on your own, have you read all the materiel?  
I’m  
sure the answers have all been covered.

If you’re finding it difficult, then maybe the course is not for you,  
because if you were working on a real project, the problems are not so  
contrived, and the answers aren’t so obvious.

For this specific problem; consider (or Google) the difference between  
assignment and comparison operators in Ruby.

On Jun 5, 2010 10:24 AM, “Srinivas G.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

Explain the error in the following sample of Ruby code. Reference the  
line which the error is found on:

1- my\_grade = “A+”  
2-  
3- if my\_grade = “A+”  
4- puts “PASSED!!!”  
5- end

–  
You received this message because you are subscribed to the Google  
Groups  
“Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
