Skip to content

Commit ecbc3c6

Browse files
committed
Added multiplication tables and animal name filter
This commit includes : Printing multiplication tables of 6 and 7 from 1 to 10 I created a new list of animals with 7 letter names for easy reference.
1 parent 2b89760 commit ecbc3c6

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

Loops/script.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,23 @@
6262
while(i < len(squares) and squares[i] == 'orange'):
6363
new_squares.append(squares[i])
6464
i = i + 1
65-
print(new_squares)
65+
print(new_squares)
66+
67+
# Your little brother has just learned multiplication tables in school. Today he has learned tables of 6 and 7 help him memorise both the tables by printing them using a for loop
68+
print("The multiplication table of 6 = ")
69+
for i in range (10):
70+
print("6*",i,"=",6*i)
71+
print("The multipluication table of 7 = ")
72+
for i in range (10):
73+
print("7*",i,"=",7*i)
74+
75+
# Your brother needs to write an essay on the animals he saw at the zoo whose names are made of 7 letters help him find those animals through a while loop and create a seperate list for such animals
76+
Animals = ["lion","giraffe","gorilla","parrots","crocodile","deer","swan"]
77+
New = []
78+
i = 0
79+
while i<len(Animals):
80+
j = Animals[i]
81+
if(len(j)==7):
82+
New.append(j)
83+
i = i+1
84+
print(New)

0 commit comments

Comments
 (0)