logo

AQA A-Level Computer Science practice

What is the value of total after this Python 3 code runs? def get_values(): return 3, 4 first, second = get_values() total = first + second

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

What is the value of total after this Python 3 code runs? def get_values(): return 3, 4 first, second = get_values() total = first + second.

  1. A.3
  2. B.4
  3. C.7
  4. D.34

Answer and explanation

Concise answer

7

Why this is correct

The subroutine returns two values, 3 and 4. They are assigned to first and second respectively, so total becomes 3 + 4, which is 7.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions