Exercise Set 16

Exercise 1 of 6

Write a condition to check if a list called numbers contains the number 5.

Your code

Exercise 2 of 6

Write a condition to check if a list called names contains the value "Jude".

Your code

Exercise 3 of 6

Write the start of the loop to iterate over the list of numbers.
numbers = [1, 2, 3, 4, 5, 6]
# start of loop here
  print(number / 2)

Your code

Exercise 4 of 6

Say hello to each person in the list.
names = ["James", "Nicole", "Helen", "Troy"]

Your code

Exercise 5 of 6

Write the start of the loop to replace each element in the list with a number twice its size.
numbers = [1, 2, 3, 4, 5]
# start of loop here
  numbers[i] = numbers[i] * 2
print(numbers)

Your code

Exercise 6 of 6

Replace each name with the first name in the list, and print out the list.
names = ["James", "Nicole", "Helen", "Troy"]

Your code