1
- import colorama , random
2
- from colorama import Fore
3
- colorama .init (autoreset = True )
4
- num_rows = 30
5
- colors = [Fore .RED ,Fore .YELLOW ,Fore .GREEN ,Fore .BLUE ,Fore .MAGENTA ]
6
- for i in range (0 , num_rows ):
7
- for j in range (0 , num_rows - i - 1 ):
8
- print (end = " " )
9
- for j in range (0 ,i + 1 ):
10
- print (random .choice (colors ) + "#" , end = " " )
11
- print ()
12
- print (Fore .BLACK + " " ,random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "#" )
13
- print (Fore .BLACK + " " ,random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "#" )
1
+ import colorama , random
2
+ from colorama import Fore
3
+ colorama .init (autoreset = True )
4
+ num_rows = 30
5
+ colors = [Fore .RED ,Fore .YELLOW ,Fore .GREEN ,Fore .BLUE ,Fore .MAGENTA ]
6
+ for i in range (0 , num_rows ):
7
+ for j in range (0 , num_rows - i - 1 ):
8
+ print (end = " " )
9
+ for j in range (0 ,i + 1 ):
10
+ print (random .choice (colors ) + "#" , end = " " )
11
+ print ()
12
+ print (Fore .BLACK + " " ,random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "#" )
13
+ print (Fore .BLACK + " " ,random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "#" )
14
14
print (Fore .BLACK + " " ,random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "# " + random .choice (colors )+ "#" )
0 commit comments