tìm số lớn nhất số nhỏ nhất
unknown
python
3 years ago
466 B
10
Indexable
numbers = input("Enter a list of numbers separated by spaces: ").split()
# Chuyển chuỗi đầu vào thành danh sách các số
numbers = [int(x) for x in numbers] # Chuyển đổi tất cả các phần tử của danh sách thành số nguyên
max_num = max(numbers) # Tìm số lớn nhất trong danh sách
min_num = min(numbers) # Tìm số nhỏ nhất trong danh sách
print("The maximum number is:", max_num)
print("The minimum number is:", min_num)
Editor is loading...