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,zwith the values10,20,30respectively. - The assignment should be done in a single line of code.
Getting Started with Python
Data Types
Python Functions
Statements in Python
Basic Debugging in Python
Basic Algorithm
Object-Oriented Programming
Error Handling
Intermediate Algorithm
Python Modules