Skip to content

Commit cd06c05

Browse files
committed
Finalizing Nested Loop
1 parent b7a523b commit cd06c05

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

basics/NestedFor/Multi-Dimentional.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
courseStudents = [
2+
["BSIT","Sherwin"],
3+
["BSCS","Angel"],
4+
["BSIS","Riven"],
5+
["BSECE","Lam"]
6+
]
7+
8+
for student in courseStudents:
9+
for info in student:
10+
print(info)
11+
print()

basics/NestedFor/challenge.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
'''
2+
Extracting The Data
3+
4+
**Given the Collection**
5+
6+
student = [
7+
[’BSIT’ , [’David’ , ‘Arlene’]],
8+
[’BSCS’,[’Jaymar’,’Emman’,’Patrick’]]
9+
]
10+
11+
Print them in a way that you will Distinguish who are the BSIT and BSCS
12+
13+
NOTE :Only use NESTED FOR LOOP
14+
15+
'''
16+
17+
students = [
18+
['BSIT', ['David', 'Arlene']],
19+
['BSCS', ['Jaymar', 'Emman', 'Patrick']]
20+
]
21+
22+
for student in students:
23+
print(f'{student[0]} Student')
24+
for info in student[1]:
25+
print(f'- {info}')
26+
print()

basics/NestedFor/range.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
for x in range(5):
2-
for y in range(x+1):
2+
for y in range(x):
33
print("*", end=" ")
44
print()
5-
5+
66
# Code to print a heart shape using asterisks (*)
77
for row in range(6):
88
for col in range(7):
@@ -11,4 +11,3 @@
1111
else:
1212
print(" ", end=" ")
1313
print()
14-

0 commit comments

Comments
 (0)