logo

Question detail

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, check the answer, then read the explanation to understand the curriculum point.

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

Model answer

What a good answer should say

  • 7

Explanation

Why this works

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

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.