Editor settings

General settings

Save settings

Learn to program with Python

Assigning Multiple Variables #

In addition to assigning a single value to a variable, you can also assign multiple values to multiple variables using tuple unpacking. For example, to assign the values 1, 2, and 3 to variables "a", "b", and "c", respectively, you can use the following code:

a, b, c = 1, 2, 3

Exercise #

  • Assign the variables x, y, z with the values 10, 20, 30 respectively.
  • The assignment should be done in a single line of code.
Output will be displayed here