Loops Exercises
Write a
whileloop that prints out all the numbers from 1 to 25 inclusive.Write an
untilloop that prints out all of the numbers that are less than 20 and are not divisible by 6.Write a method,
#sum_up_to(number)that, given a number, sums all the numbers from 1 to that number, inclusive. It should use awhileloop internally.Write a method,
print_factors(number)that prints all of the factors of a number, including 1 and the number itself. You'll need to use a while loop, a conditional statement, and the modulo operator!