Skip to content

Commit

Permalink
add password generator
Browse files Browse the repository at this point in the history
  • Loading branch information
blissjaspis committed Sep 13, 2021
1 parent 499a86f commit 9754bb9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 02_Password_Generator/generator.py
@@ -0,0 +1,12 @@
import random
import string

try:
length = int(input("Masukkan jumlah panjang password : "))
formula = string.ascii_letters + string.digits + string.punctuation
print('Your password: ' + "".join(random.sample(formula, length)))
except KeyboardInterrupt:
print("\nyou quit to generate password")
except Exception as e:
print("Gagal memasukkan data")

0 comments on commit 9754bb9

Please sign in to comment.