Last active
September 3, 2021 16:21
-
-
Save ppeuchin/d4843c03b26217b6f07d458b57504431 to your computer and use it in GitHub Desktop.
A program that reads integers from the user until the user enters 0 and stores them in a list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The program then displays all the values except 0 from the smallest to the largest, with each integer appearing on different lines. | |
nums_list = [] | |
while True: | |
num = int(input("Enter an integer: ") | |
if num == 0: | |
break | |
else: | |
nums_list.append(num) | |
nums_list.sort() | |
print("\nResults:\n") | |
for i in nums_list: | |
print(" ",i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment