mercredi 21 janvier 2015

how do i complete my piece of code from the point i am at? [on hold]

I'm making a program which prints out a number and a symbol randomly to form a sum and someone has to answer it and it prints out if it correct or incorrect. I need to make it print out 10 times and for it to be turned into a question such as


X (*+-) X =...


Where '...' is there answer


And this has to be asked 10 times!


Thanks everyone and remember im a beginner so please don't make it sound really complicated :D


Here is the code so far:



import random

integers = [ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,18,20]
symbols = ['+', '-', '*']

print(random.choice(integers))
print(random.choice(symbols))
print(random.choice(integers))




Aucun commentaire:

Enregistrer un commentaire