Exercise to Try
Counting to forty – Write a program using a “for loop” to create and output numbers
ranging from 10 to 60 with 60 inclusive.
One hundred – Create a list of numbers ranging from 1 to 100. Furthermore, use the
conditional test “for loop” to display the numbers on the screen.
Summing one hundred numbers – After creating your 100 numbers, save using
another name, and perform the following tasks on it. Find the minimum, maximum,
and sum of the 100 numbers with 100 excluded.
Four – Compile a list of multiples of 4 from 4 to 40. Ensure to use a for loop for this
program and print the output
Cube – Calculate the cube of the first 10 numbers. A cube is the third power of a
number. Use a “for loop” to generate the number and print the value of the cube.
Do'stlaringiz bilan baham: |