mercredi 23 mars 2022

Generate random User ID with a function ; including quantity_digits and quantity_list being provided as arguments

Please note I am only allowed to use Math and Random class

so for this, I was considering using "for loop" for the number of of digits restriction from quantity_digit and use ''.join() function to add things up. The list might be like this ["333322","999883"].

I was wondering how do I for each iteration, randomly pick an element and within that element, pick random number from it. Can this be done? Please help

so this is I want to do

  1. define the function 2)for loop for addition of the characters from the string
  2. choose random string from the list each iteration
  3. and (each iteration) in that list I want to select several characters from that specific String
  4. use join() function to add things up



Aucun commentaire:

Enregistrer un commentaire