Skip to content

Instantly share code, notes, and snippets.

@ysnerdem
Last active October 24, 2017 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysnerdem/0ad88f085c65d3b3c92e164ae9ffa78e to your computer and use it in GitHub Desktop.
Save ysnerdem/0ad88f085c65d3b3c92e164ae9ffa78e to your computer and use it in GitHub Desktop.
numbers = []
while True:
num = int(input('Enter number:'))
numbers.append(num)
if len(numbers) == 10:
break
neg_nums = 0
pos_nums = 0
zero = 0
for i in numbers:
if i > 0:
pos_nums += 1
elif i < 0:
neg_nums += 1
else:
zero += 1
print("negative numbers:",neg_nums)
print("positive numbers:",pos_nums)
print("zeros:",zero)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment