Created
October 15, 2015 10:20
-
-
Save drvinceknight/ad53821387bfb73df098 to your computer and use it in GitHub Desktop.
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
count = 0 # Initialising a variable to count numbers divisible by 11 | |
s = 0 # Initialising a variable to add all numbers divisible by 11 | |
powers = 1 # Multiple 2 together as many times as we have numbers divisible by 11 | |
for i in range(101): # Loop over numbers we want | |
if i % 11 == 0: # Identify numbers that are divisible by 11 | |
count += + 1 # Add 1 | |
s += i # Add the number itself | |
powers = powers * 2 # Multiple by 2 | |
print count, s, powers # Print all of these |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment