Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://stackoverflow.com/questions/63289079/how-to-draw-steps-in-python
- # --- functions ---
- def get_info():
- steps = int(input("How many steps? "))
- height = int(input("Step height? "))
- width = int(input("Step width? "))
- offset = int(input("Step offset? "))
- return steps, height, width, offset
- def draw_row(width, offset):
- print(' '*offset, end='')
- print('* '*width, end='')
- print()
- def draw_rectangle(height, width, offset):
- for i in range(height):
- draw_row(width, offset)
- def main():
- steps, height, width, offset = get_info()
- for i in range(steps):
- # every rectangle need differen offset - offset*0, offset*1, offset*2, etc.
- draw_rectangle(height, width, offset*i)
- # --- start ---
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement