Trouble running the magic 8 ball program

after typing php index.php i get a $ symbol. I then typed magic8Ball(); and pressed enter, but instead of the function running, i get:

bash: syntax error near unexpected token `;’

What does this mean?
Any ideas in trying to run the program assuming i did all what was asked for in the lessons?

Welcome, @script0131595176,

Please post the URL of the exercise page so that we might get our bearings on this question.

It is the Magic 8 Ball project.
I figured it out. I had to call the function at the end of my coding. So when i enter php index.php again , it worked. The instructions on this project weren’t entirely clear, but i look through the past lessons, and figured it out. Thanks.

I am having trouble with this code. It won’t print random numbers.

import random

name = “Sebastian”

question = “Will I go back to school?”

answer = “”

random.randint(1, 9)

random_number = random.randint(1, 9)

thank you in advance for your help

that code seems to be missing the print
I guess you should have
at the end.

1 Like