Python Developer: Python Variables - Assign Multiple Values | Tutorial 6

Pubblicato il: 02 settembre 2025
sul canale di: Professional Skill 2023
41
3

Python Variables - Assign Multiple Values
1-Many Values to Multiple Variables
Python allows you to assign values to multiple variables in one line:
x, y, z = "Orange", "Banana", "Cherry"
2-One Value to Multiple Variables
And you can assign the same value to multiple variables in one line:
x = y = z = "Orange"
3-Unpack a Collection
If you have a collection of values in a list, tuple etc. Python allows you to extract the values into variables. This is called unpacking.
fruits = ["apple", "banana", "cherry"]
x, y, z = fruits


In questa pagina del sito puoi guardare il video online Python Developer: Python Variables - Assign Multiple Values | Tutorial 6 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Professional Skill 2023 02 settembre 2025, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 41 volte e gli è piaciuto 3 spettatori. Buona visione!