Courses › Introduction to Programming ›Looping Notes › Worksheet
Loop Worksheet Worksheet
Complete these exercises before running the code in Godot.
- Using a for loop, create the following sequence iteratively:
1 2 3 4 5 6 7 8 9 10
-
Create the same sequence as question 1, but using a while loop.
-
Create the following pattern using a while loop:
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5
- Ask the user for a number that is greater than 1. Using a loop, sum up the total of all the integers from 1 to the number they entered. This includes the number they gave. An example is provided below for testing.
Enter a number greater than 1: 10 The sum is: 55
- Ask the user for a number from 1 to 10 inclusively. Print out a multiplication table for that number that goes from 1 to 10 inclusively.