lundi 3 décembre 2018

Function not returning random integer for variable

I have a very simple problem, when I run the following code:

from random import randint

def create_random():
  x = random.randint(1,4)
  return x 

print(create_random)

The output comes to this:

< function create_random at 0x7f5994bd4f28 >

Note: every character between "0x7f" and "f28" are random each time the code is run.

My goal was to be able to call the function multiple times with x being assigned a new integer value between 1 and 3 with each invocation.




Aucun commentaire:

Enregistrer un commentaire