numbers = [int(x) for x in input("Enter the list of numbers separated by space: ").split()]
sorted_numbers = sorted(numbers)
max_number = max(sorted_numbers)
min_number = min(sorted_numbers)
print("Sorted list:", sorted_numbers)
print("Max number:", max_number)
print("Min number:", min_number)
print("Numbers greater than previous in the list:")
for i in range(1, len(sorted_numbers)):
if sorted_numbers[i] > sorted_numbers[i - 1]:
print(sorted_numbers[i])
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
numbers = [int(x) for x in input("Enter the list of numbers separated by space: ").split()]
sorted_numbers = sorted(numbers)
max_number = max(sorted_numbers)
min_number = min(sorted_numbers)
print("Sorted list:", sorted_numbers)
print("Max number:", max_number)
print("Min number:", min_number)
print("Numbers greater than previous in the list:")
for i in range(1, len(sorted_numbers)):
if sorted_numbers[i] > sorted_numbers[i - 1]:
print(sorted_numbers[i])