ex1.1
This commit is contained in:
parent
d540e77118
commit
a0c6bc139e
1
.gitignore
vendored
1
.gitignore
vendored
@ -158,3 +158,4 @@ cython_debug/
|
||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
Session.vim
|
||||
|
||||
16
art.py
Normal file
16
art.py
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
# art.py
|
||||
|
||||
import sys
|
||||
import random
|
||||
|
||||
chars = '\|/'
|
||||
|
||||
def draw(rows, columns):
|
||||
for r in range(rows):
|
||||
print(''.join(random.choice(chars) for _ in range(columns)))
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) != 3:
|
||||
raise SystemExit("Usage: art.py rows columns")
|
||||
draw(int(sys.argv[1]), int(sys.argv[2]))
|
||||
Loading…
x
Reference in New Issue
Block a user