What is the easiest way to generate a random +,-,*, or / sign using the import random function while assigning this to a letter.
E.G.
g = answeryougive('+','-')
Thanks in advance :)
Thanks i am doing my GCSE great help
there are several ways to do this but the best is using random.choice for random symbols or random.radiant for numbers Eg.
import random
Num1=random.radiant(1,12) #random number one
Num2=random.radiant(1.12) #random number two
sym=random.choice(['+','/','*'.'-']) #random symbol