Answered You can hire a professional tutor to get the answer.
Modify the largest.py program below to mark both the smallest and the largest elements ?
Modify the largest.py program below to mark both the smallest and the largest elements ?
# Create an empty list.
values = []
# Read the input values.
print("Please enter values, Q to quit:")
userInput = input("")
while userInput.upper() != "Q" :
values.append(float(userInput))
userInput = input("")
# Find the largest value.
largest = values[0]
for i in range(1, len(values)) :
if values[i] > largest :
largest = values[i]
# Print all values, marking the largest.
for element in values :
print(element, end="")
if element == largest :
print(" <== largest value", end="")
print()