Im having trouble with homework assignment, i need to ask a user for a number and location and then store that number into the specific location in the list. my python skills are pretty basic but any help would be greatly appreciated.
Question:
Two players take turns inserting a number in the range of 0 through 9 into the array at any empty location. Each player can choose any remaining number, but each number can only be used once.
example of what is supposed to happen:
player 1: you're number? 7
position to be entered? 9
position: 1 2 3 4 5 6 7 8 9 10
| | | | | | | | |7| |
my failed attempt:
data = []
x = raw_input('integer: ')
for i in range(10):
data.insert(9, x)
print(data)