Menu

Sign in to track your progress and unlock all features.

Theme style

Log in

Full lesson preview

Assign Multiple Variables

Use a single assignment statement to bind multiple variables at once. Practice tuple unpacking and returning multiple values.

Python practice6 minVariables & Data TypesBeginnerLast updated December 29, 2025

Problem statement

Given three input values, assign them to variables a, b, and c using one multiple-assignment statement (e.g., a, b, c = ...). Return the three variables as a tuple (a, b, c). The goal is to practice assigning multiple variables on a single line.

Task

Learn how to assign several variables in one line using multiple assignment and return them as a tuple.

Examples

Assign three integers

Input

assign_multiple(1, 2, 3)

Output

(1, 2, 3)

All three inputs are assigned to a, b, c in one line and returned as a tuple.

Input format

A function call assign_multiple(x, y, z) with three values.

Output format

Return a tuple (a, b, c) containing the three assigned values.

Constraints

Inputs can be any valid Python values (numbers, strings, lists, None, etc.). Keep the assignment to a single multiple-assignment statement.

Samples

Sample 1

Input

assign_multiple('a', 'b', 'c')

Output

('a', 'b', 'c')

Strings are assigned and returned in the same order.