This forum is now read-only. Please use our new forums! Go to forums
"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
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
Answer 558cda67937676541b000304
1 comments
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 comments
my_name should replace to myname
Answer 555a2aa751b8872aec000819
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?
2 comments
couldn’t agree more. It annoys me so much
im a completionist and this 99% progress will annoy me
Answer 5557e0cc9113cbef2500008a
So sorry. I missed the part where it said to print a random number.
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
1 comments
not working, there is something wrong with the code checker