# Count Emptiness Help \[SOLVED\]

**URL:** <https://discourse.codecombat.com/t/count-emptiness-help-solved/22139>\
**Category:** Level Help\
**Created:** [June 9, 2020, 9:57pm UTC](https://discourse.codecombat.com/t/count-emptiness-help-solved/22139 "2020-06-09T21:57:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kp237218](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@kp237218](https://discourse.codecombat.com/u/kp237218)\
**Post date:** [June 9, 2020, 9:57pm UTC](https://discourse.codecombat.com/t/count-emptiness-help-solved/22139/1 "2020-06-09T21:57:51Z")

</div>

```python
# Solve the riddler puzzle and find the treasure.
# Count the whitespace on both sides of a riddle.

# This function moves the hero N steps right.
def moveNSteps(n):
    hero.moveXY(hero.pos.x + 8 * n, hero.pos.y)

# Read the riddle.
riddle = hero.findNearestEnemy().riddle
# Trim whitespace from both sides and store in a variable
trimmed = riddle.trim()
# Find the difference between the `riddle` and `trimmed` lengths:

# Use the result and moveNSteps function to move to the spot:
moveNSteps()
# Say something there!
hero.say("somethings there!")

```

type or paste code here

```python

```

can anyone tell me what find the difference between the riddle and trimmed lengths means?

---

<div class="post-metadata">

**Author:** ![dedreous](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/dedreous/32/13849_2.png) [@dedreous](https://discourse.codecombat.com/u/dedreous)\
**Post date:** [June 9, 2020, 11:18pm UTC](https://discourse.codecombat.com/t/count-emptiness-help-solved/22139/2 "2020-06-09T23:18:00Z")

</div>

Think about a string as a literal collection of characters. A space at the beginning or end, aka whitespace, also counts as a character. So

```python
test1 = "..this is a test.." # pretend the dots are just spaces.
test2 = "this is a test"

len1 = len(test1) # which comes out to a length of 18 characters
len2 = len(test2) # which comes out to a length of 14

test3 = test2.trim
len3 = len(test3) # which comes out to a length of 14

```

So, that is telling you to subtract the two items and use the difference to move that many steps. In your code, ‘riddle’ is the original text. ‘trimmed’ is after it is cleaned up…trimmed. Take the difference between the two, and pass that as the ‘n’ variable to your function.

---

<div class="post-metadata">

**Author:** ![kp237218](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@kp237218](https://discourse.codecombat.com/u/kp237218)\
**Post date:** [June 10, 2020, 9:42pm UTC](https://discourse.codecombat.com/t/count-emptiness-help-solved/22139/3 "2020-06-10T21:42:34Z")

</div>

that you so much that was really helpful
