python - How to get my output to "You rolled 2, 3, 2, 4, (ETC)" -
the code have far
for in range(6): roll1 =int(random.randint(1,6)) print ("you rolled",roll1)
i need print out
you rolled 3,4,5,6,2
but output looks like:
you rolled 4 rolled 4 rolled 1 rolled 1 rolled 6 rolled 6
try this:
from random import randint print( "you rolled " + ",".join(str(randint(1,6)) j in range(6)) )
wiki
Comments
Post a Comment