This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by tanpinche_coursera
almost 9 years

"Your printed output from rand() should be an integer."

I thought that we were supposed to print the letter, not the number. Can somebody explain what’s going on? Even when I print the number it still says I’m going wrong. ``

Answer 557bfee0937676ce6000012a

3 votes

Permalink

Hi Tanpinche,

The 2 blank spaces in your full name will occasionally generate an error as they expect a character (letter). Error message: “Oops, try again. The random output you printed from your name should be just one character.”

Delete echo $ch; from your code as there will be an error message “Oops, try again. The random output you printed from your name should be a letter.” The result is a number and letter, ie 10e, 5i, 9h etc when you print substr.

Also, remove // from your last line of code.

As shown below:

  • Part 1
points
Submitted by Saburi Yu
almost 9 years

1 comments

lightbrute over 8 years

not working, there is something wrong with the code checker

Answer 558cda67937676541b000304

2 votes

Permalink

points
Submitted by Sileye Sarr
almost 9 years

1 comments

Reianna-Bryant over 8 years

What does the “$ch” stand for, and how does it fit into the lesson? It was not explained in the information bow..

Answer 555838db9113cbb4200000a7

1 vote

Permalink

points
Submitted by anask7
almost 9 years

1 comments

sergpr almost 9 years

my_name should replace to myname

Answer 555a2aa751b8872aec000819

1 vote

Permalink

Yeah, this is a bug with codecademy. I’ve tried multiple working solutions, everything returns “Your printed output from rand() should be an integer.” I’m done screwing around with this.

The PHP tutorial has been noticeable lower quality than the others at codecademy. The interpreter is constantly crashing, probably because it’s live-interpreting the input with every new character you type in. They’re are other bugs too… did they even test this one?

points
Submitted by ideascape
almost 9 years

2 comments

CoosWolff almost 9 years

couldn’t agree more. It annoys me so much

Gavin Hardison almost 9 years

im a completionist and this 99% progress will annoy me

Answer 5557e0cc9113cbef2500008a

-1 votes

Permalink

So sorry. I missed the part where it said to print a random number.

points
Submitted by tanpinche_coursera
almost 9 years