Skip to content

Instantly share code, notes, and snippets.

@ppeuchin
Last active September 3, 2021 16:21
Show Gist options
  • Select an option

  • Save ppeuchin/d4843c03b26217b6f07d458b57504431 to your computer and use it in GitHub Desktop.

Select an option

Save ppeuchin/d4843c03b26217b6f07d458b57504431 to your computer and use it in GitHub Desktop.

Revisions

  1. ppeuchin revised this gist Sep 3, 2021. No changes.
  2. ppeuchin revised this gist Sep 3, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions until_0.py
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # 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: ")
  3. ppeuchin created this gist Sep 3, 2021.
    14 changes: 14 additions & 0 deletions until_0.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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)