the-honk/school/gcse/year 9/python challenges/24 - Draw a line with Xs and spaces.py
2024-10-09 18:02:36 +01:00

16 lines
No EOL
266 B
Python

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)