Lecture 6.3 | Assign Multiple Values in Python with Code Examples | GenZ Ma'am
GenZ Ma'am
0:00 / 0:00
Lecture 6.3 | Assign Multiple Values in Python with Code Examples | GenZ Ma'am
26 просмотров · 12 дн. назад
GenZ Ma'am
37 подписчиков
26 просмотров · 12 дн. назад
In this lecture, we’ll learn how to assign multiple values to multiple variables in Python using simple syntax and practical code examples. You’ll also learn how to assign the same value to multiple variables and unpack multiple values into separate variables.
This concept makes your Python code cleaner, easier to read, and more efficient.
What You’ll Learn in This Video:
_ How to assign multiple values to multiple variables
_ How to assign different values in a single line
_ How to assign the same value to multiple variables
_ How to unpack values into multiple variables
_ Practical examples using strings and numbers
_ Common mistakes beginners should avoid
Code Examples:
```python
Assign multiple values to multiple variables
name, age, city = "Dua", 20, "Karachi"
print(name)
print(age)
print(city)
Assign the same value to multiple variables
x = y = z = 100
print(x, y, z)
Unpack values from a list
fruits = ["Apple", "Banana", "Mango"]
a, b, c = fruits
print(a)
print(b)
print(c)
```
👍 Like this video if you find it helpful.
💬 Comment your questions below.
🔔 Subscribe to GenZ Ma'am for more Python lectures, coding tutorials, and educational content!
#python #pythonvariables #AssignMultipleValues #pythonprogramming #learnpython #pythonforbeginners #pythontutorial #pythoncourseforbeginners #codingforbeginners #GenZMaam
LinkedIn: / dua-gaju-baa564305
E-mail: duaokaygaju04@gmail.com