# Assigning Rvalue

**URL:** <https://discourse.codecombat.com/t/assigning-rvalue/7896>\
**Category:** Solved\
**Created:** [June 6, 2016, 5:52pm UTC](https://discourse.codecombat.com/t/assigning-rvalue/7896 "2016-06-06T17:52:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Skabelund](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Jonathan\_Skabelund](https://discourse.codecombat.com/u/Jonathan_Skabelund)\
**Post date:** [June 6, 2016, 5:52pm UTC](https://discourse.codecombat.com/t/assigning-rvalue/7896/1 "2016-06-06T17:52:06Z")

</div>

Hi i am not able to find out the problem in my code  
’ if 1 + 1 == 3: # ∆ Make this false.  
hero.moveXY(5, 15) # Move to the first mines.

if 2 + 3 == 5: # ∆ Make this true.  
hero.moveXY(15, 40) # Move to the first gem.

# != means “is not equal to”.

if 2 + 2 == 4: # ∆ Make this true.  
hero.moveXY(25, 15) # Move to the second gem.

# \< means “is less than”.

if 2 + 2 \< 5: # ∆ Make this true.  
enemy = hero.findNearestEnemy()  
hero.attack(enemy)

if 2 \< 1: # ∆ Make this false.  
hero.moveXY(40, 55)

if True 3 = 0: # ∆ Make this false.  
hero.moveXY(50, 10)

if False 2 + 3 = 9: # ∆ Make this true.  
hero.moveXY(55, 25)`

---

<div class="post-metadata">

**Author:** ![Serg](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/serg/32/3260_2.png) [@Serg](https://discourse.codecombat.com/u/Serg)\
**Post date:** [June 6, 2016, 6:02pm UTC](https://discourse.codecombat.com/t/assigning-rvalue/7896/2 "2016-06-06T18:02:44Z")

</div>

Please format your code by surrounding it top and bottom with triple backticks ( ` )

---

<div class="post-metadata">

**Author:** ![Jonathan\_Skabelund](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Jonathan\_Skabelund](https://discourse.codecombat.com/u/Jonathan_Skabelund)\
**Post date:** [June 6, 2016, 6:10pm UTC](https://discourse.codecombat.com/t/assigning-rvalue/7896/3 "2016-06-06T18:10:50Z")

</div>

```python
if 1 + 1 == 3: # ∆ Make this false.
    hero.moveXY(5, 15) # Move to the first mines.

if 2 + 3 == 5: # ∆ Make this true.
	hero.moveXY(15, 40) # Move to the first gem.

# != means "is not equal to".
if 2 + 2 == 4: # ∆ Make this true.
	hero.moveXY(25, 15) # Move to the second gem.
	
# < means "is less than".
if 2 + 2 < 5: # ∆ Make this true.
    enemy = hero.findNearestEnemy()
    hero.attack(enemy)

if 2 < 1: # ∆ Make this false.
	hero.moveXY(40, 55)

if True 3 = 0: # ∆ Make this false.
	hero.moveXY(50, 10)

if False 2 + 3 = 9: # ∆ Make this true.
	hero.moveXY(55, 25)

```

---

<div class="post-metadata">

**Author:** ![Serg](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/serg/32/3260_2.png) [@Serg](https://discourse.codecombat.com/u/Serg)\
**Post date:** [June 6, 2016, 6:13pm UTC](https://discourse.codecombat.com/t/assigning-rvalue/7896/4 "2016-06-06T18:13:35Z")

</div>

```python
if True 3 = 0: # ∆ Make this false.
	hero.moveXY(50, 10)

```

Is not properly formatted code.

`True` is a keyword, `3` will be rendered as a number, `=` is the `assignment-operator`, and `0` is another number.

The simplest way to make `True` false would be to write it as `False` instead.

Further the `rvalue` error is a result of trying to assign a variable inside of an `if-statement`.

`=` is the assignment operator. It assigns something to something else.

`==` is a comparison (equality) operator, and checks if two things are equal.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Skabelund](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@Jonathan\_Skabelund](https://discourse.codecombat.com/u/Jonathan_Skabelund)\
**Post date:** [June 6, 2016, 6:21pm UTC](https://discourse.codecombat.com/t/assigning-rvalue/7896/5 "2016-06-06T18:21:00Z")

</div>

i solved it thanks for trying to help i appreciated that

---

<div class="post-metadata">

**Author:** ![Versus\_PanZer](https://avatars.discourse-cdn.com/v4/letter/v/278dde/32.png) [@Versus\_PanZer](https://discourse.codecombat.com/u/Versus_PanZer)\
**Post date:** [June 8, 2016, 11:54am UTC](https://discourse.codecombat.com/t/assigning-rvalue/7896/6 "2016-06-08T11:54:19Z")

</div>

And what are === for?  
To check is [1,53,235] equal to [1,53,235] and to compare with null?
