Жауабы: Number of parameter(s) of the function
Это официальный ключ к заданию, источник — варианты Национального центра тестирования. Свой ответ можно сверить на странице тапсырма.
Бланкке: таңдалған нұсқа нөмірі.
Number of parameter(s) of the function
Instruction: You are offered the test items on the base of text with one correct answer from four proposed ones. Read the text attentively and do the items.
List of numbers
Teacher gives to Ali unique n natural numbers and asks to sort this sequence in descending order without using sort() and sorted() functions. He has written the following code. However, during the execution program did not show the result as intended. Help him to fix the code.
def sorting (list):
for i in range(0,len(list)-1):
for j in range(i, len (list)-1): #incorrect
if list[i]<list[j]:
temp = list[i]
list[i] = list[j]
list[j] = temp
list = []
n=int(input())
for i in range(n):
list.append(int(input()))
sorting (list)
print (list)