dimanche 1 juillet 2018

Python how to include a string with random integer [duplicate]

I want to make a random police unit generator and the code is like so:

import random
unitnumbers = ('unit' , random.randint(1,999))
print(unitnumbers)

However, rather than printing "unit 63" , it prints ('unit', 378)

How could I make it print only the unit and random number?




Aucun commentaire:

Enregistrer un commentaire