Kita Kata wrote:
It does print x randomly, however, not like how the exercise wants it.
Here is the expected output:
xxxxxxx
xxxxxxxxxxxxx
xxxxxx
xxxxxxxxxxx
xxxxxxxxxxxxxxxxx
Here is my output:
...
Can someone please tell me where I've gone wrong?
Welcome to the Ranch!
Where you have gone wrong is thinking that the "expected output" is literally what your program should output. Since you are using random numbers, then the actual output will
randomly vary from the "expected" output. What that really is is an example of what you might reasonably expect from the program. The key thing to note is that all the lines in the output, except for the last one, has less than 16 "x"s.
For future reference, when you are posting code, please
UseCodeTags (←click on that; it's a link to a page that tells you how to use code tags). As a first-time courtesy, I will edit your post to add them for you.