Skip to content
MathsGenie logo
Open app

Course home

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

Computational thinking

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
Question 35

Refer to the Python code below.

1      # ----- Global variables -----
2      gemstones = ["Ruby", "Sapphire", "Emerald", "Diamond", "Amethyst"]
3
4      # ----- Subprograms -----
5      def showGemstones (items):
6          for i in range (0, len (items)):
7              print (i, items[i])
8
9      # ----- Main Program -----
10     choice = input ("Show gemstone collection? ")
11     if ((choice == "yes") or (choice == "y")):
12         showGemstones (gemstones)
13     else:
14         print ("Goodbye")

Give the value of gemstones[3].

[1]

Computational thinking Questions

  1. GCSE
  2. /Computer Science
  3. /Computational thinking