97.9k views
5 votes
Python projectstem 3.6 code practice

Write a program to input 6 numbers. After each number is input, print the smallest of the numbers entered so far.

Sample Run
Enter a number: 9
Smallest: 9
Enter a number: 4
Smallest: 4
Enter a number: 10
Smallest: 4
Enter a number: 5
Smallest: 4
Enter a number: 3
Smallest: 3
Enter a number: 6
Smallest: 3

1 Answer

3 votes

Answer:

python

Step-by-step explanation:

list_of_numbers = []

count = 0

while count < 6:

added_number = int(input("Enter a number: "))

list_of_numbers.append(added_number)

list_of_numbers.sort()

print(f"Smallest: {list_of_numbers[0]}")

count += 1

User Kashfa Khan
by
3.3k points