mardi 17 octobre 2017

Cant call on list object when generating from a list

import random

avchars = ['a','b','c','d','e','f','g']
ra = random.randint(8,24)
rb = random.randint(1,7)
for i in range(ra):
  file = open("pass","w")
  ac = avchars(rb)
  print(ac)
  file.write(ac)
file.close()
print("Done")

I want to generate 8-24 characters from the list above. However, I receive the error:

TypeError: 'list' object is not callable




Aucun commentaire:

Enregistrer un commentaire