Skip to content

Commit 8bcf902

Browse files
author
evans1989
committed
Create 1001S02E04_control_flow.py
1 parent c4fd4a6 commit 8bcf902

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

1901060026/1001S02E04_control_flow.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Filename : multiplication_table.py
2+
# Author by : Evans
3+
4+
#Task1 : Use for in list the multiplication_table
5+
print("Multiplication_table:")
6+
for i in range(1,10):
7+
for j in range (1,i+1):
8+
print ('{}x{}={}\t'.format(i,j,i*j),end='')
9+
print ('')
10+
print('\n')
11+
12+
13+
14+
#Task2 : Only show the odd line of the multiplication_table
15+
print('Odd line of the Multiplication_table:')
16+
for i in range(1,10):
17+
if i % 2 == 0 :
18+
i += 1
19+
continue
20+
for j in range(1,i+1):
21+
print('{}x{}={}\t'.format(i,j,i*j),end='')
22+
print('')
23+
24+
25+

0 commit comments

Comments
 (0)