Skip to content

Course home

Develop code

Develop code

EasyMediumHard
1234567891011121314151617181920212223242526
Question 15

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]
Markscheme

Develop code Questions

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

62 exam-style questions on Edexcel IGCSE Computer Science Develop code. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank