Computer Science, asked by guptkeshav35, 17 days ago

1.write a program to accept (n) no.in a list and print sorted list. python urgent ​

Answers

Answered by chotaraju39
0

Answer:

numlist=[]

n=int(input("Number of elements:"))

for i in range(0,n):

elem=int(input())

numlist.append(elem)

print(numlist)

#I hope it helps

Answered by samarthkrv
0

Answer:

x = int(input("Enter the number of elements in the list:"))

numbers = []

print("Enter all",x,"elements in the list:");

for i in range(x):

n = int(input())

numbers.append(n)

print("BEFORE SORTING-")

print(numbers)

numbers.sort()

print("AFTER SORTING-")

print(numbers)

Explanation:

Similar questions