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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -