Skip to content

Commit cd332a2

Browse files
author
ash
committed
day 5 done
1 parent 9772c1a commit cd332a2

File tree

8 files changed

+66
-5
lines changed

8 files changed

+66
-5
lines changed

Day 5/For Loops with Range/task-info.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ files:
66
- name: solution.py
77
visible: true
88
learner_created: false
9-
status: Unchecked
9+
status: Solved
1010
record: -1
1111
post_submission_on_open: true

Day 5/For Loops with Range/task.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
x = 0
2+
for i in range(1,101):
3+
x += i
4+
5+
print(x)

Day 5/For Loops/task-info.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ files:
66
- name: solution.py
77
visible: true
88
learner_created: false
9-
status: Unchecked
9+
status: Solved
1010
record: -1
1111
post_submission_on_open: true

Day 5/For Loops/task.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
fruits = ["Apple", "Peach", "Pear"]
2+
for fruit in fruits:
3+
print(fruit)
4+
print(fruit + " pie")

Day 5/Highest Score/task-info.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ files:
66
- name: solution.py
77
visible: true
88
learner_created: false
9-
status: Unchecked
9+
status: Solved
1010
record: -1
1111
post_submission_on_open: true

Day 5/Highest Score/task.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
student_scores = [150, 142, 185, 120, 171, 184, 149, 24, 59, 68, 199, 78, 65, 89, 86, 55, 91, 64, 89]
2-
print(range(1, 10))
2+
#print(range(1, 10))
3+
x = 0
4+
y = 1
5+
z = len(student_scores)
6+
7+
for i in student_scores:
8+
for v in student_scores:
9+
if i > student_scores[y] and y <= z:
10+
y += 1
11+
else:
12+
i = student_scores[y]
13+
14+
15+
print(i)
16+
17+

Day 5/Password Generator Project/task-info.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ files:
66
- name: solution.py
77
visible: true
88
learner_created: false
9-
status: Unchecked
9+
status: Solved
1010
record: -1
1111
post_submission_on_open: true

Day 5/Password Generator Project/task.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import random
12
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
23
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
34
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
@@ -8,3 +9,40 @@
89
nr_numbers = int(input(f"How many numbers would you like?\n"))
910

1011

12+
#easy version
13+
x = 0
14+
y = 0
15+
z = 0
16+
letr = []
17+
symb = []
18+
num = []
19+
20+
for i in letters:
21+
if len(letr) < nr_letters:
22+
letr.append(random.choice(letters))
23+
24+
for i in symbols:
25+
if len(symb) < nr_symbols:
26+
symb.append(random.choice(symbols))
27+
28+
for i in numbers:
29+
if len(num) < nr_numbers:
30+
num.append(random.choice(numbers))
31+
32+
pswd = letr + symb + num
33+
34+
x = str()
35+
36+
for i in pswd:
37+
x += i
38+
39+
print(x)
40+
41+
42+
#Hard version
43+
y = str()
44+
random.shuffle(pswd)
45+
for i in pswd:
46+
y += i
47+
48+
print(y)

0 commit comments

Comments
 (0)