This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Control Flow: Switch Forum

View Course

2061 points
59af83f2836966a3aa0000d9_119471782
Submitted by
infinitycoder16
about 2 years ago

6/6 ??

switch ($shape) {
case 0:
echo "Number";
echo "Circle is a number";
break;
case 1:
echo "Person";
echo "Circle is a person";
break;
case 2:
echo "Hat";
echo "Circle is a hat";
break;
case 3:
echo "shape";
echo "Circle is a shape";
break;
}

Why does it output NumberCircle is a number? When I actually want it to say shapeCirle is a shape? 

0 votes

permalink

you forgot to put the default condition

38 points
0ffba72df5454b30fbc02975577455e6?s=140&d=retro
Submitted by
pstlvictoras_5610f18ce39efe9e4f0001b
about 2 years ago