logo

Crowdly

Consider:   scores = {"Asha": 6, "Ben": 4, "Cara": 6, "Dan": 8}   ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Consider: 

scores = {"Asha": 6, "Ben": 4, "Cara": 6, "Dan": 8} 

passed = [] 

distinct_scores = set() 

 

for name in scores: 

    if scores[name] >= 6: 

        passed.append(name) 

        distinct_scores.add(scores[name]) 

 

Explain what values name takes during the loop and what scores[name] retrieves. [2 marks] 

More questions like this

Want instant access to all verified answers on moodle1.maths.ed.ac.uk?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!