+ 2
How can I write a code which compares numbers (written by the spectator) and then shows these numbers in ascending or descending order.*and works with any quantity of numbers.
Greater than, less than
2 Answers
0
https://ghostbin.com/paste/akfu6
This is an example where you write the numbers but you can place instead of the numbers inside the array some variables with user data.
0
numbers = []
answer = 'yes'
while answer == 'yes':
x =int(input('give me a number'))
numbers.append(x)
answer = input('do you want to enter a new number?')
numbers.sort()
descendent = numbers[::-1]
print(descendent)
it works on computer, in the application you cannot manage the answer -input.