12 lines
211 B
Python
12 lines
211 B
Python
nums = [8,90,19,12,7,6,55,98];
|
|
|
|
for i in range(len(nums)-1):
|
|
key = nums[i];
|
|
j = i-1;
|
|
while (j >= 0 and nums[j] > key):
|
|
nums[j+1] = nums[j];
|
|
j -= 1;
|
|
|
|
nums[j+1] = key;
|
|
|
|
print(nums); |