Python Forum
Sorting ID with first and last name Arrays
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sorting ID with first and last name Arrays
#8
Just a little remark: repeatedly calling randint is not a good way to create unique ID's (you need to be quite lucky to not have duplicities if you roll sixteen times integer between 10 and 99). random.sample() is better suited for such task:
unique_id = random.sample(range(10,100), len(firstName))
Reply


Messages In This Thread
RE: Sorting ID with first and last name Arrays - by zivoni - Apr-24-2017, 12:43 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020