Commit a6b2207 1 parent b87db36 commit a6b2207 Copy full SHA for a6b2207
File tree 5 files changed +32
-1
lines changed
5 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,4 @@ def solve():
10
10
11
11
12
12
if __name__ == '__main__' :
13
- solve ()
13
+ solve ()
Original file line number Diff line number Diff line change
1
+ def solve ():
2
+ for n in range (1 , int (input ()) + 1 ):
3
+ print ('*' * n )
4
+
5
+ if __name__ == '__main__' :
6
+ solve ()
Original file line number Diff line number Diff line change
1
+ 5
Original file line number Diff line number Diff line change
1
+ *
2
+ **
3
+ ***
4
+ ****
5
+ *****
Original file line number Diff line number Diff line change
1
+ import sys
2
+ from pathlib import Path
3
+ from unittest import TestCase
4
+ from main import solve
5
+
6
+ def my_solve (testcase_input ):
7
+ sys .stdin = open (testcase_input , 'r' )
8
+ stdout = sys .stdout
9
+ sys .stdout = open ('stdout.txt' , 'w' )
10
+ solve ()
11
+ sys .stdout .close ()
12
+ sys .stdout = stdout
13
+
14
+ class Test (TestCase ):
15
+ def test1_solve (self ):
16
+ my_solve ('test1.txt' )
17
+ self .assertEqual (
18
+ Path ('test1_answer.txt' ).read_text ().strip (),
19
+ Path ('stdout.txt' ).read_text ().strip ())
You can’t perform that action at this time.
0 commit comments