Advertisement
xavicano

Untitled

Aug 4th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import random
  2.  
  3. def random_char(num_of_char):
  4.     charset="".join(chr(x) for x in range(33,127)) 
  5.     #return charset[random.randint(0,94)]
  6.     password="".join(charset[random.randint(0,94)] for y in range(num_of_char))
  7.     return password
  8.    
  9. num_of=1
  10. while num_of!=0:  
  11.     num_of=input("Num of characters? ")    
  12.     print (random_char(int(num_of)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement