Last active
May 3, 2018 00:21
-
-
Save starhopp3r/981efa53628c3e8359d5385b9d18c4d8 to your computer and use it in GitHub Desktop.
This file contains 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
# Numbers between 1534 and 2435 that are divisible by 7 | |
[print(i) for i in range(1534, 2436) if i % 7 == 0] | |
# Numbers between 1534 and 2435 that are divisible by 7 OR 8 | |
[print(i) for i in range(1534, 2436) if i % 7 == 0 or i % 8 == 0] | |
# Numbers between 1534 and 2435 that are divisible by 7 AND 8 | |
[print(i) for i in range(1534, 2436) if i % 7 == 0 and i % 8 == 0] | |
# Last question with user input | |
stop_num = int(input("Key in stop_num (>1534):")) | |
divisor = int(input("Key in divisor:")) | |
[print(i) for i in range(1534, stop_num) if i % divisor == 0] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment