QUESTION IMAGE
Question
practice question #1
what will be displayed after this code segment is run?
gems ←
uby\, \sapphire\, \garnet\
gems ← \opal\, \emerald\
display gems2
a. \opal\ b. \sapphire\ c. \garnet\
d. \emerald\
Step1: Overwrite initial list
The first line assigns gems = ["ruby", "sapphire", "garnet"], but the second line overwrites this variable with a new list: gems = ["opal", "emerald"].
Step2: Access 2nd list element
Most programming/block-based languages use 1-indexing for this style of display, so gems[2] refers to the second element in the final gems list.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
D. "emerald"