0
Python code help
I'm making a text based game, and at some point i want to make a random choice something from a list, but each one of the things in the list give you +1 point or -1 point. Example: list = ['hello', 'bye', 'good night'] x = random.choice (list) print(x) and here o wanted to do something like If x = First thing of the list, then points +1 or If x = Second thing in the list, then -1 points i tried to do It like If x = (list[0]) points = points +1 but It says "invalid sintax" on the 'if' line, i tried It for Manu diferent ways but It still don't work... pls Help me
3 Answers
+ 6
After if you need to end the line with :
And use == when you compare two values.
+ 1
Nos if vocĂȘ tem que pĂŽr "=="
+ 1
E tem que dar "import random" pra depois fazer o "random.choice"



