Skip to content
MathsGenie logo
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

Develop code

EasyMediumHard
123456789101112131415161718192021222324252627
Question 16

An incomplete Python program contains a list of gemstone names.

gemstones = ["Ruby", "Emerald", "Sapphire", "Amethyst", "Topaz", "Opal", "Garnet", "Jade"]

# Amend the loop below to only print every other gemstone starting with the first one ("Ruby")
for i in range(0, len(gemstones)):
    print(gemstones[i])

Amend the code so that it displays every other gemstone in the array, resulting in the following output:

Ruby
Sapphire
Topaz
Garnet

Do not add any further functionality.

[3]

Develop code Questions

  1. IGCSE
  2. /Computer Science
  3. /Develop code