qobjects = [
{
question: "What is a correct syntax for looping through the values of this dictionary:x = {'type' : 'fruit', 'name' : 'apple'}",
options: [
"for y in x.values():",
"
print(y)for y in x:",
"
print(y)for y in x:"
],
correct: 0
},
{
question: "Is it possible to loop through the keys of a dictionary?",
options: [
"Yes",
"No"
],
correct: 0
},
{
question: "What is a correct syntax for looping through the keys AND values of this dictionary:
print(y.value())x = {'type' : 'fruit', 'name' : 'apple'}",
options: [
"for y, z in x:",
"
print(y, z)for y, z in x.items():",
"
print(y, z)for (y, z) in x:"
],
correct: 1
},
{
question: "What is a correct syntax for looping through the keys of this dictionary:
print(y, z)x = {'type' : 'fruit', 'name' : 'apple'}",
options: [
"for y in x.names():",
"
print(y)for y in x.keys():",
"
print(y)for y in x.types():"
],
correct: 1
}
]
print(y)