IterationTasks For
IterationTasks For
Task 1 - Numbers
Write a program that uses for to display the numbers 1 to 100 inclusive.
1 x 7 = 7
2 x 7 = 14
3 x 7 = 21
4 x 7 = 28
...
12 x 7 = 84
Task 6 - Bits
Write a program that will print the number of combinations you can have with a certain amount of bits, as in the
example below. Show all the combinations up to 32 bits (Hint: 2**3 is 8 )
Task 7 - Bits
Extend the program from Task 6 so that it if the number of bits is a multiple of 8, it will display how many bytes
that is, e.g.
(continues...)
By H. Mothada. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Task 8 - To Decimal
Write a program that uses a for loop to produce the output in the screenshot below.
Hint 2: 11111111 = 27
By H. Mothada. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.