Submit a separate python file for EACH part of the assignments.
1.) Write a program that counts down from 10. Implement your program first with a while loop. Now implement
your program with a for loop. Include both versions in your submission file.
2) Write a program that prints 2n where n goes from 1 to 100. Print one answer per line (note: you are
answering the question, how high can you count on 100 fingers). Write your program using a 'for' loop.
Reminder '' is the operator for exponents, so for example 43 is 4 to the third power, or 4 * 4 * 4 which
equals 64.
E.g.
2
4
8
16
….
3.) Write a program that picks a random number from 1-100. Then ask the user to guess a number. Tell the
user if the answer is higher or lower than the number they guessed, or if they got the correct answer. Allow
them to guess again if they got the guess incorrect. They should be able to guess numbers an infinite number
of times until they get the correct answer, at which point your loop will end.
To generate a number from 1-100 you will need the following code at the beginning of your program:
from random import randint
randomNum = randint(1,100)
Sample Solution