Help me for this project
pikachu223

Help me for this project Animal Trivia

You are viewing a single comment. View All
CodeMaster007

Hey! So in your code, it says

print('answer correct')

This is the format for python 2. For python 3, you do ". Heres a example...

print("Hello World!") #this is python 3

print('Hello World!') #this is python 2

I see a few more errors but this should be a good start for everything else. You mixed python 2 with 3 in a few parts so look carefully.
If you have any other questions, add me to the doc and I'll help you with it
Thanks,

CodeMaster007

pikachu223
pikachu223

@CodeMaster007 and this:File "main.py", line 9
if attempt < 2
^
SyntaxError: invalid syntax

CodeMaster007

You have too large of a space. Like a tab on the keyboard . Click backspace till its just one ahead. @pikachu223

ZarmDev

@pikachu223 if attempt < 2:
you need a ":"

doineednumbers

@CodeMaster007 no, both work in 3

CodeMaster007

Ok. So maybe hello world works in 3 but other commands do not. There is a reason why there are 2 different pythons. Python 2 and 3. @doineednumbers

doineednumbers

@CodeMaster007 There's also a reason why they're both python. I think you're thinking of the difference between print "hi" and print("hi")

CodeMaster007