Skip to content

Instantly share code, notes, and snippets.

@ysnerdem
Last active October 24, 2017 23:07
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/ec9f32785ae67a77b548454c1e3d03a4 to your computer and use it in GitHub Desktop.
Save ysnerdem/ec9f32785ae67a77b548454c1e3d03a4 to your computer and use it in GitHub Desktop.
print('Please enter numbers')
print('You can terminate by entering -1 when you enter as many numbers as you want')
numbers = []
while True:
num = int(input('Number:'))
numbers.append(num)
if num == -1:
break
max=0
for i in numbers:
if i > max:
max = i
print('Largest number:',max)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment