From 0d282b524d5a8ed9393dff82169a71224df3ca10 Mon Sep 17 00:00:00 2001 From: Natalia Date: Sat, 2 Nov 2024 01:50:23 +0100 Subject: [PATCH] solution/m1-008 --- projects/008-random-password/python/main.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/projects/008-random-password/python/main.py b/projects/008-random-password/python/main.py index e69de29..a240f09 100644 --- a/projects/008-random-password/python/main.py +++ b/projects/008-random-password/python/main.py @@ -0,0 +1,13 @@ +import random + +def random_password(): + password_length=random.randint(7,10) + random_password="" + + for i in range(password_length): + character=chr(random.randint(33,126)) + random_password+=character + + return random_password + +print(f"The randomly generated password is: {random_password()}") \ No newline at end of file