Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save timeowilliams/964f260cdcb3caaa4dc4329ececa9eb0 to your computer and use it in GitHub Desktop.

Select an option

Save timeowilliams/964f260cdcb3caaa4dc4329ececa9eb0 to your computer and use it in GitHub Desktop.
Practice Python 4: Adding numbers to lists
num = int(input('Enter a number: '))
x = []
count = 1
while count < num:
if num % count == 0:
x.append(count)
count += 1
else:
count += 1
print(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment