Skip to content

Instantly share code, notes, and snippets.

@Frontear
Created September 29, 2020 13:15
Show Gist options
  • Save Frontear/13e7361eb48671b80f66fdb355e055fb to your computer and use it in GitHub Desktop.
Save Frontear/13e7361eb48671b80f66fdb355e055fb to your computer and use it in GitHub Desktop.
This is the code for CPS109 Lab 3
nums = []
while True:
x = float(input("Please enter a number: "))
nums.append(x)
if x < 0.0:
break
for x in range(len(nums)):
print(str(nums[x]), end="")
if x != len(nums) - 1:
print(" + ", end="")
print(" = " + str(sum(nums)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment