lundi 7 juin 2021

python copy return value to another function [closed]

There is code below. If rand() has value 3, how can I execute same value from rand2 function? Because rand() function have random module, rand() function and rand2() function's values are always different.

import random
import copy

def rand():
    a=random.randint(1,10)
    return a

def rand2():
    b=rand()
    return b

Aucun commentaire:

Enregistrer un commentaire