Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a_str = "x"
- position = int(input("Input a position between 1 and 10: "))
- a = 0
- b = 9
- c = 0
- d = 0
- for i in range(1,10):
- new_str = a_str * (a) + "o" + a_str * b
- if i == position:
- print(new_str)
- c = a
- d = b
- a += 1
- b -= 1
- print("l - for moving left")
- print("r - for moving right")
- print("Any other letter for quitting")
- while True:
- if move !="r" and move !="l":
- break
- else:
- for i in range(1, 10):
- def main_str(l):
- if move == "l":
- l = a_str * (c-i) + "o" + a_str * (d+i)
- print(l)
- return l
- def my_str(r):
- if move == "r":
- r = a_str * (c+i) + "o"+ a_str * (d-i)
- print(r)
- return r
- move = input("Input your choice: ")
- l = main_str(move)
- r = my_str(move)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement