File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ def solution (x , n ):
2+ answer = []
3+ for i in range (n ):
4+ answer .append (x * (i + 1 ))
5+ return answer
6+
7+ x1 = 2
8+ x2 = 4
9+ x3 = - 4
10+
11+ n1 = 5
12+ n2 = 3
13+ n3 = 2
14+
15+ print (solution (x1 , n1 ))
16+ print (solution (x2 , n2 ))
17+ print (solution (x3 , n3 ))
Original file line number Diff line number Diff line change 1+ def solution (phone_number ):
2+ answer = '*' * (len (phone_number )- 4 ) + phone_number [- 4 :]
3+ return answer
4+
5+ phone_number1 = "01033334444"
6+ phone_number2 = "027778888"
7+
8+ print (solution (phone_number1 ))
9+ print (solution (phone_number2 ))
Original file line number Diff line number Diff line change 1+ def solution (arr1 , arr2 ):
2+ for i in range (len (arr1 )):
3+ for j in range (len (arr1 [i ])):
4+ arr1 [i ][j ] += arr2 [i ][j ]
5+
6+ return arr1
7+
8+ arr1 = [[1 ,2 ],[2 ,3 ]]
9+ arr2 = [[1 ],[2 ]]
10+ arr3 = [[3 ,4 ],[5 ,6 ]]
11+ arr4 = [[3 ],[4 ]]
12+
13+ print (solution (arr1 , arr3 ))
14+ print (solution (arr2 , arr4 ))
15+
You can’t perform that action at this time.
0 commit comments