L AB 4 July 5th
F OR LOOP Exercise 1: Find two ways of “Summing all 1, 2, and 3 digit prime numbers.” Use for loop Hint: isprime, primes
F OR LOOP
C ONVERT THE F OR LOOP TO W HILE LOOP Exercise 2:
C ONVERT THE F OR LOOP TO W HILE LOOP
F OR LOOP Exercise 3: Duplicate each element in an array Input: Array [1,2,3,4] Output: Array [1,1,2,2,3,3,4,4]
C HALLENGE Q UESTION : N ESTED L OOPS Exercise 4 Printing Out rows of Stars Ask the user for how many rows
C HALLENGE Q UESTION : N ESTED L OOPS