Python if else statement
Question: My if statement works but else doesn't can anyone help me? this is my code.
Btw if anyone knows how to ask for a retry after one time would be awesome!

    
    
    import random
    
    print('choose a number between 1 and 10,if you guess right you get 10 points if you guess wrong you lose 15points')
    
    answer = input()
    
    randint = random.randint(0,2)
    
    print('the answer is ',randint)
    
    if [answer == randint]:
    
     print('gratz! you win 10points!')
    
    else:
    
     print('you lose 15points!')
    


Answer: Don't put brackets around your `if` statement. When you do that, you are
creating a new list. Change it to this:

    
    
    if answer == randint:
    

You could put parentheses around it if you wanted to, but not `[]`. Your
second problem is that `random.randint()` returns an integer, but `input()`
returns a string (in Python3). You could say `if int(answer) == randint:`
instead, or you could say `if answer == str(randint):`. Your third problem, as
@cricket_007 pointed out is `randint(0, 2)` will return an integer between `0`
and `2`, not `1` and `10`. Just change that line to `randint =
random.randint(1, 10)`.

