Я очень новичок в программировании и занимаюсь этим в основном как хобби, чтобы снять стресс с работы, я только начал пробовать себя на python и пытаюсь найти диапазон количества X чисел.
программа работает, но вместо возвращаемых минимальных и максимальных значений она использует последние 2 значения из списка.
Как я уже сказал, я делаю это как хобби и не обладаю огромным опытом, но я не сомневаюсь, что это что-то простое, но я изо всех сил пытаюсь понять, почему он не принимает значения, которые он должен.
numSales = int(input("How many numbers are you entering? "))
# creates a variable for number of numbers, allowing the list to be of length determined by the user
noNumbers = []
# creates list called noNumbers
maxListLength = numSales
# gives the maximum length of the list called dailySales
while len(noNumbers) < maxListLength:
item = input("Enter a number to add to the list: ")
noNumbers.append(item)
# Asks for an input as long as the number of variables in dailySales is less than the value of maxListLength
print(noNumbers)
lowest = int(min(noNumbers))
# returns the lowest value of dailySales
print(lowest)
highest = int(max(noNumbers))
# returns the largest value of dailySales
print(highest)
numRange = int(highest - lowest)
# need to subtract highest from lowest to print the sales range
print(numRange)
Заранее спасибо за помощь