Skip to content

Commit fb528d6

Browse files
committed
project_2.py
1 parent 8e96786 commit fb528d6

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

project_2.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import random
2+
letters = ['a','b','c','d','e','f','g','h','i','j','k',
3+
'l','m','n','o','p','q','r','s','t','u','v',
4+
'w','x','y','z','A','B','C','D','E','F','G','H','I','J',
5+
'K','L','M','N','O','P','Q','R','S','T','U','V','W',
6+
'X','Y','Z']
7+
symbols = ['!','@','#','$','%','^','&','*','(',')','+']
8+
numbers = ['1','2','3','4','5','6','7','8','9','0']
9+
10+
print("Welcome to Password Generator!")
11+
12+
n_letters=int(input("How many letters would you like in your password?"))
13+
14+
n_symbols=int(input("How many symbol would you like?"))
15+
16+
n_numbers=int(input("How many numbers would you like?"))
17+
password_list=[]
18+
for i in range(1,n_letters+1):
19+
char=random.choice(letters)
20+
password_list+=char
21+
for i in range(1,n_symbols+1):
22+
char=random.choice(symbols)
23+
password_list+=char
24+
for i in range(1,n_numbers+1):
25+
char=random.choice(numbers)
26+
password_list+=char
27+
print(password_list)
28+
random.shuffle(password_list)
29+
print(password_list)
30+
password=""
31+
for char in password_list:
32+
password+=char
33+
print(password)

range_function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
print(b[2])"""
55
c=range(-2,15,2)#2 5 (start,stop,step)
66
"""start>stop if nt true then empty
7-
- Positive step → start < stop
7+
- Positive step → start < stop*
88
- Negative step → start > stop
99
- equal step=stop->empty
1010
"""

sum.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@
55
total+=i
66
print(total)
77

8-
for i in range(1,101):
9-
total+=i
10-
print(total)
8+

0 commit comments

Comments
 (0)