0
numbers = [2,3,1,5,7,8,9,5,4,6] 
print(numbers)
tool_1 = int(input())
tool_2 = int(input())
x = numbers.index (tool_1)
y = numbers.index (tool_2)
numbers[x] = (tool_2)
numbers[y] = (tool_1)
print(numbers)

So I want this code to run until the numbers list is in this exact order 1,2,3,4,5,6,7,8,9
Is there a Do until loop or someway I can do this?

Edited by Reverend Jim: Corrected code formatting

3
Contributors
2
Replies
19
Views
4 Months
Discussion Span
Last Post by DarkPikachu
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.