Why isn't this simple code working?

I’m doing exercise 9 on the free python course and can’t figure out what i am doing wrong.

It asks me to define a variable cucumbers, bigger than 1 and needs to be an integer.

I am writing "cucumbers = 3 " and it keeps saying it is wrong.

https://imgur.com/a/8rjIu (Image showing the problem).


I trust you are not writing it in quotes?

const cucumbers = 3

I am not writing it in quotes, i thought that for integer variables there is no need for quotes?

There is no need for quotes on any variable. If quoting inline code, use a single back tick on the code.

`cucumbers = 3`

That way we don’t get confused when we see code in quotes. The back ticks will mark down the code inline.

To post a block of code, use three back ticks before and after…

cucumbers = 3
cost_of_cucumbers = 3.25
total_cost = cucumbers * cost_of_cucumbers

which will render in the post like so…

cucumbers = 3
cost_of_cucumbers = 3.25
total_cost = cucumbers * cost_of_cucumbers

I understand but this is still not working and shouldn’t the code cucumbers = 3 suffice?

Can’t say. Please post a link to the exercise. Thanks.


Sorry, was giving JavaScript.

cucumbers = 3

is enough to meet the requirements of step 1.

1 Like

I’m experiencing the same issue. I assume that its just a recent bug?

Also experiencing the same thing!

Same problem, and the rest of the lessons after this has the same issues. Pretty broken for new members overall…


I am going through this course and getting the same error.
It should just be cucumbers = 3
That is not working though.

A friend and I are experiencing the same issue. Make sure to report this as a bug at the bottom of the left side of the exercise window.

Experiencing the same. Correct code is not being recognised in exercise 9 and every exercise following this. Very frustrating!

So does this mean that everybody is stuck on exercise 9? lol I’m stuck there too.


Yeah, this is where I’m at, too. Will just send a bug report and wait for it to be fixed. No big.

Try this. Worked for me, might work for you.

cucumbers = int(2)
price_per_cucumber = float(3.25)

The intended solution works for me. Is anyone else experiencing this error?

Thanks, but it appears to be working as it should now.

1 Like