468,740 Members | 2,018 Online

# Code isnt working

here is my code but for some reason "if Choice == "Right":" is a traceback could I please have some help? (here is link to the random import: https://www.w3schools.com/python/module_random.asp)

#Stay under 21 but above -5 this is that game! Welcome to That Game!

import random

print("Hello Welcome to Control! In this game you will need to attempt to stay under 21 yet above -5 by typing left or right based on a format like this one: (Left)x (Right)y where 1 would be x and 2 would be y, now without further a doo let the games begin!")
print("Ok!" , Name , "Lets begin!")
#CN = Current number
CN = random.randrange(-5,21)
PlusMinus=["+","-"]
left = random.randrange(-5,21)
right = random.randrange(-5,21)
Operator = random.choice(PlusMinus)
Choice = input("Left Or Right?: ")
print("(Left)" , Operator + str(left),"(Right)" , Operator , str(right)
if Choice == "Right":
CN = str(CN) + str(right)
int(CN)
elif Choice == "Left":
CN = str(CN) + str(left)
int(CN)
3 Weeks Ago #1
1 1186
SioSio
252 128KB
The ")" in the print statement is missing.
Expand|Select|Wrap|Line Numbers
1. print("(Left)" , Operator + str(left),"(Right)" , Operator , str(right))
3 Weeks Ago #2