Created
September 18, 2020 16:18
-
-
Save timeowilliams/964f260cdcb3caaa4dc4329ececa9eb0 to your computer and use it in GitHub Desktop.
Practice Python 4: Adding numbers to lists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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