the-honk/gcse computer science/year 9/python challenges/24 - Draw a line with Xs and spaces.py

16 lines
266 B
Python
Raw Normal View History

2021-05-28 20:38:55 +00:00
def drawLine(spaces, xs):
string = '';
for space in range(spaces):
string = string + ' ';
for x in range(xs):
string = string + 'x';
print(string)
# draw an egg
drawLine(5,7)
drawLine(4,9)
drawLine(3,11)
drawLine(4,9)
drawLine(5,7)