3/4 [Conditionals and Control Flow] - Found a bug, I assume


Okay, so I'm in a bit of a pickle here...


Once I enter the code, which is below, it states that my code does not output the correct phrase - but it does!

        $items = 3;
        if($items > 5) {
          echo "You get a 10% discount!";
        else {
            echo "You get a 5% discount";

Help would be appreciated! Possibly a bug?


I've just realised how dumb I was being..

It wanted:

You get a 5% discount!

I was outputting:

You get a 5% discount

Bloody punctuation...


getting the same error
$items = 3;

if($items > 5) {
  echo "You get a 10% discount!";
else {
   echo "You get 5% discount!";

I am seeing this in console window--- You get 5% discount!

And this is the error I am getting ----
Oops, try again. Did you set your else statement to echo or print 'You get a 5% discount!' ? Don't forget your semicolon at the end!


I'm getting the same error! even if i applied the punctuation!


hey i got it!
just write 3 in the variable value


jai le meme probleme

il me demande de rajouter else alors que cest fait je ne sais plus quoi faire a l aide merci


ecrire 3 exactement jai essayer


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.