1.write a program to accept (n) no.in a list and print sorted list. python urgent
Answers
Answered by
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
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