Тёмный

Python the Walrus Operator := 

ClarityCoders
Подписаться 49 тыс.
Просмотров 6 тыс.
50% 1

Today let's talk about Python's newest operator.
#Python #Shorts
Subscribe to our new streaming channel! If I get 50 I'll do a live stream.
/ @claritystreams1393
👊You got something to say to me?? Join our discord!✌️
/ discord

Наука

Опубликовано:

 

27 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 12   
@bigwalrosswalross3356
@bigwalrosswalross3356 2 года назад
For me its the best operator name of all time :)
@ClarityCoders
@ClarityCoders 2 года назад
Wish this could be pinned on all my videos.
@not_pockchan3418
@not_pockchan3418 2 года назад
Ty for the tip! All the less code to write for me
@daylen577
@daylen577 2 года назад
Isn't this the default behavior in most languages, though? You can just say `x = y = z = 5` to assign all three, as `z = 5` also returns 5
@ClarityCoders
@ClarityCoders 2 года назад
In python z = 5 doesn't return anything. Try the while loop I showed without the operator and it won't work. It get assigned but not returned.
@daylen577
@daylen577 2 года назад
@@ClarityCoders Oh no I understand that it doesn't in Python. I just find it interesting that this would require a separate operator, as other languages don't have one and that has never really seemed to be an issue. Is there even a use case for specifically not returning the value?
@nikolais6452
@nikolais6452 2 года назад
@@daylen577 surely assigning values inside expressions leads to unfollowable code tho?
@OrangeNerd1
@OrangeNerd1 2 года назад
@@ClarityCoders yeah its interesting that a separate operator is required, for example in Java doing something like while ((x = iterator.next()) != null) { // } is perfectly valid. Anyone know why a separate operator is needed in python?
@ClarityCoders
@ClarityCoders 2 года назад
@@daylen577 Got ya! Great question I'm not sure of a use case for not returning the value. Great point.
@d3_xd900
@d3_xd900 2 года назад
i have to pay money to keep my bot on :(((((((((((((((((
@BoredBoy888
@BoredBoy888 8 месяцев назад
I dont get the point. Can someone explain the benefit or usecase?
@tommyispog8026
@tommyispog8026 2 года назад
Ah I got second comment today :D
Далее
What is The Walrus Operator in Python?
12:45
Просмотров 14 тыс.
Python's Walrus Operator??
2:39
Просмотров 125 тыс.
Python Tips: What is the Walrus Operator?
0:52
Просмотров 1,9 тыс.
The Most Legendary Programmers Of All Time
11:49
Просмотров 565 тыс.
Game Automation with YOLOv8: Python Bot Tutorial
21:40
25 nooby Python habits you need to ditch
9:12
Просмотров 1,8 млн
This Is Why Python Data Classes Are Awesome
22:19
Просмотров 807 тыс.
Walrus Operator | Python Tutorial
9:23
Просмотров 1,5 тыс.
basics of CODING in 10 minutes
15:34
Просмотров 1,5 млн
Huawei с тремя экранами
1:00
Просмотров 271 тыс.
Скучнее iPhone еще не было!
10:48
Просмотров 589 тыс.
РАСПАКОВКА АЙФОНА 16 PRO MAX
1:01
Просмотров 1,1 млн