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 :)
You want random.choice
random.choice(['+', '-'])
Or more concisely:
random.choice('+-')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With