vendredi 6 juillet 2018

Couldnt find 'tuple' object is not callable

from random import seed, randint, random    
seed()
print ( "A random number between 1 and 10 is", randint(1, 10) )
print ( "Another is", randint(1, 10) )    
seed(0)
print ( "3 random numbers are:", random(), random(), random() )
seed(0)
print ( "The same 3 numbers are:", random(), random(), random() )
seed(1)
x = random(), random()
print ( "Random numbers from Group A are:", random(), random() )

Error

TypeError                                 Traceback (most recent call last)
<ipython-input-113-3f5f0d61a508> in <module>()
      2 
      3 seed()
----> 4 print ( "A random number between 1 and 10 is", randint(1, 10) )
      5 print ( "Another is", randint(1, 10) )
      6 

TypeError: 'tuple' object is not callable


I have tried adding in commas, deleting the shown line, and all it does is just showing me theres an error on the upcoming print() lines. What went wrong?




Aucun commentaire:

Enregistrer un commentaire