lundi 17 février 2020

concatenate list to int

when using a list, I saw that I cannot add or subtract the sample I took from the list. For example:


import random

x = random.sample ((1 ,2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13), k=1 )
print(x + 1)


Why can’t I add unto the list I created, and how can I get around that issue?




Aucun commentaire:

Enregistrer un commentaire