jeudi 15 juillet 2021

Adding every two nunbers in a list

I have the following problem

Import random

List = range(0,64)

a = random.sample(list,16)

print(a)

So I get 16 random numbers.

Now what I want further is to add every two numbers in the random set of 16 elements even with each number to be added with itself.

Please help

Thanks




Aucun commentaire:

Enregistrer un commentaire