Learn Python LIST COMPREHENSIONS in 10 minutes! 📃

  Рет қаралды 19,432

Bro Code

Bro Code

Күн бұрын

List comprehension = A concise way to create lists in Python
Compact and easier to read than traditional loops
[expression for value in iterable if condition]
doubles = [x * 2 for x in range(1, 11)]
triples = [y * 3 for y in range(1, 11)]
squares = [z * z for z in range(1, 11)]
fruits = ["apple", "orange", "banana", "coconut"]
uppercase_words = [fruit.upper() for fruit in fruits]
fruit_chars = [fruit[0] for fruit in fruits]

Пікірлер: 46
@BroCodez
@BroCodez 8 ай бұрын
# List comprehension = A concise way to create lists in Python # Compact and easier to read than traditional loops # [expression for value in iterable if condition] doubles = [x * 2 for x in range(1, 11)] triples = [y * 3 for y in range(1, 11)] squares = [z * z for z in range(1, 11)] fruits = ["apple", "orange", "banana", "coconut"] uppercase_words = [fruit.upper() for fruit in fruits] fruit_chars = [fruit[0] for fruit in fruits] numbers = [1, -2, 3, -4, 5, -6, 8, -7] positive_numbers = [x for x in numbers if x >= 0] negative_numbers = [x for x in numbers if x < 0] even_numbers = [x for x in numbers if x % 2 == 0] odd_numbers = [x for x in numbers if x % 2 == 1] grades = [85, 42, 79, 90, 56, 61, 30] passing_grades = [grade for grade in grades if grade >= 60]
@BrunoVinicius-ix8wt
@BrunoVinicius-ix8wt 4 ай бұрын
This is the best programming channel on KZbin. Period.
@ma_astro
@ma_astro Ай бұрын
bro once again proves that he makes the best programming content out there
@oseaniic
@oseaniic 5 ай бұрын
Like the 3rd video I watch about it, and I finally understood it 2 mins in, thanks a lot for being this great!
@Ctrl-Z-Renders
@Ctrl-Z-Renders 8 ай бұрын
You are both a good teacher and a good person, i think that because you got 6000 usd for a good cause!
@kqndy_6349
@kqndy_6349 2 ай бұрын
best tutorial i had ever watched about list comprehensions
@stephenl5693
@stephenl5693 2 күн бұрын
Very easy to understand your tutorial 👍. I've already watched a few other yt videos on same topic they just made it a bit more complicated.
@SabonaMarara
@SabonaMarara 8 ай бұрын
true teacher
@LuisAvila-f5h
@LuisAvila-f5h 4 ай бұрын
@ranjeetprasad4586
@ranjeetprasad4586 8 ай бұрын
I am from India what a melodious voice u have
@hrishikeshXXV
@hrishikeshXXV 6 ай бұрын
Cringe
@Imad_SH
@Imad_SH 5 ай бұрын
So Gay
@ranjeetprasad4586
@ranjeetprasad4586 5 ай бұрын
@@Imad_SH are you gay , no problem
@ranjeetprasad4586
@ranjeetprasad4586 5 ай бұрын
But why you write that u are gay
@LuisAvila-f5h
@LuisAvila-f5h 4 ай бұрын
@@ranjeetprasad4586 erm what the sigma
@aj_the_cutiepatootie
@aj_the_cutiepatootie 8 ай бұрын
Bro Code teaching me more in 10 minutes than my IT teacher teaching me the same material in 2 weeks😭
@elijahsokoni7997
@elijahsokoni7997 4 ай бұрын
Thanks mate. Brilliant tutorial
@gianghoang4594
@gianghoang4594 8 ай бұрын
Love your vids
@ahmetunaldi7601
@ahmetunaldi7601 3 ай бұрын
Bro is great....
@samarthpawar181
@samarthpawar181 Ай бұрын
Thanks
@technicalswag3925
@technicalswag3925 8 ай бұрын
Sir please continue and complete the react course
@JuanTheone11
@JuanTheone11 6 ай бұрын
This dude is the definition of Gigachad
@lucasbozdog5922
@lucasbozdog5922 2 ай бұрын
great tutorial thank you
@xzex2609
@xzex2609 8 ай бұрын
I wonder if bro making these videos, recently . cause after making React tutorials he wants to take some time off. if it is we are all happy that you back. and we hope to learn Next.js from you.
@JohnBrillianton
@JohnBrillianton 7 ай бұрын
Thanks Bro
@tamalchakraborty5346
@tamalchakraborty5346 4 ай бұрын
Thank the gods for the formula.
@alinegomes9084
@alinegomes9084 8 ай бұрын
loved
@Halkdzdf
@Halkdzdf 8 ай бұрын
W video as always
@immersiveparadox
@immersiveparadox 12 күн бұрын
❤❤
@InnnocentladSMCtradinghub
@InnnocentladSMCtradinghub 8 ай бұрын
Sit back relax and enjoy
@Norro_o
@Norro_o 8 ай бұрын
pls make a video about explaining grid in css🙏🙏
@jihane-x2z
@jihane-x2z 8 ай бұрын
can u pls mmake a video about numpy arrays
@NinjaDude_YT
@NinjaDude_YT 8 ай бұрын
When I try to run the script at 4:54, I keep getting this AttributeError and exit code 1. What happened?
@xzex2609
@xzex2609 8 ай бұрын
you may confuse fruit (singular) with fruits (plural) if you get error , also you need to use () after fruit.upper() upper = [ fruit.upper() for fruit in fruits]
@Veryprogamer123
@Veryprogamer123 8 ай бұрын
tutoiral on ALL of oop please
@wndos
@wndos 8 ай бұрын
150 missed calls from coding schools
@afinotantemisan8622
@afinotantemisan8622 Ай бұрын
You should’ve included “else”
@titangamer7906
@titangamer7906 5 ай бұрын
I can just say you are smarter than chat gpt !
@facegrace_sk6584
@facegrace_sk6584 3 ай бұрын
Great video, watch it. (like and comment so more people find this video)
@Veryprogamer123
@Veryprogamer123 8 ай бұрын
third!
@BroCodez
@BroCodez 8 ай бұрын
nice
@exyoris4079
@exyoris4079 8 ай бұрын
why is he redoing these python videos? he already had made a video on list comprehensions
@nickreffner4574
@nickreffner4574 2 ай бұрын
Maybe he wanted to expand or explain the concepts differently. Maybe he wanted to juice the algorithm for that sweet sweet ad revenue? Maybe my replying to this 6-month-old comment also boosts it? 👍👌
@tamalchakraborty5346
@tamalchakraborty5346 4 ай бұрын
How do the fit 2 in the list of odd numbers with List comprehension?
5 Useful Dunder Methods In Python
16:10
Indently
Рет қаралды 68 М.
Learn Python MATCH-CASE STATEMENTS in 5 minutes! 📆
5:55
Bro Code
Рет қаралды 13 М.
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
10 Python Comprehensions You SHOULD Be Using
21:35
Tech With Tim
Рет қаралды 169 М.
How I Would Learn Python FAST (if I could start over)
12:19
List Comprehension - BEST Python feature !!! Fast and Efficient
14:51
Python Simplified
Рет қаралды 201 М.
Learn Python DECORATORS in 7 minutes! 🎊
7:22
Bro Code
Рет қаралды 26 М.
Python List Comprehensions Made Easy!!
11:50
Travis Media
Рет қаралды 19 М.
Learn Python OOP in under 20 Minutes
18:32
Indently
Рет қаралды 187 М.
11 Tips And Tricks To Write Better Python Code
11:00
Patrick Loeber
Рет қаралды 626 М.
SUPER() in Python explained! 🔴
13:06
Bro Code
Рет қаралды 19 М.
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.