List Comprehension - BEST Python feature !!! Fast and Efficient

List Comprehension - BEST Python feature !!! Fast and Efficient

Python Simplified

2 года назад

188,512 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Patrick Lehmann
Patrick Lehmann - 03.07.2022 17:33

Using list comprehension for print is a very bad example. Compared to the the ordinary for-loop, an implicit list of return values from print is generated.

Also the statement, that append(...) isn't used in list comprehension isn't true. It's not explicitly written as code, but somehow, elements need to be added to the list.

The presentation states that some code is faster than other code, but no evidence is shown e.g. by using timeit.

boolean values shouldn't be compared (==) with True. At first use "is True". At second, a call to the "is" operator can be skipped, because a boolean can be used directly in an if statement.
Moreover there is no if-statement needed, as booleans can be directly converted to integers by calling int(...).

list comprehension for strings ...
I have no words how silly this is.

---------------
Sorry, but such tutorials are the root cause for so many bad Python code in the world.
Just because you can do it, doesn't mean you should do it; neither you should teach others !

There are many good use cases for list comprehensions. There are also lots of use cases when list comprehensions are more compact, more readable and way faster than ordinary loops. But the given examples in this tutorial are neither.

Ответить
Slade Sylvain
Slade Sylvain - 12.10.2023 08:31

I love your way of teaching, I understand it perfectly,

Ответить
Anita Prabhu
Anita Prabhu - 11.10.2023 18:38

Thanks a lot for the tutorial and you are exuberant. Love your teaching style too. Looking forward for more. 🙏🏼

Ответить
Octavio Ramirez
Octavio Ramirez - 08.10.2023 20:42

Thank you Bananas Mariya. I learned a lot.

Ответить
Ashraful Alam
Ashraful Alam - 06.10.2023 22:03

Can you please upload a video on Pascal's triangle?

Ответить
wake_for_go
wake_for_go - 04.10.2023 20:18

Great 🎉

Ответить
J
J - 26.09.2023 21:55

Hi Maria

Ответить
Pratap
Pratap - 23.09.2023 20:03

Develop a program that computes the sum of even and odd numbers in a list separately using list comprehension.

please give mi the solution of this question.

Ответить
Oren
Oren - 23.09.2023 01:56

Thank you! very helpful explanation

Ответить
chessketeer
chessketeer - 22.09.2023 18:37

Thank you! You are a very good teacher👍

Ответить
munibabu BODAGALA
munibabu BODAGALA - 09.09.2023 13:11

One should learn from her how to teach to viewers or students offline or online, she got a gift of smile on her face, that makes her more beautiful in teaching, she is so passionate in teaching.

Ответить
Azhar Akbar
Azhar Akbar - 03.09.2023 07:39

Awesome video. You made the whole concept so easy. Thank You.

Ответить
Mohammed Salim
Mohammed Salim - 01.09.2023 01:21

I don't know why but it's starting to smell like wet dog. btw thank you so much, this was really helpful.

Ответить
Leri Patsatsiya
Leri Patsatsiya - 31.08.2023 09:19

Thanks a lot Maria :) Love your videos. It was an awesome "list comprehension" explanation.

Ответить
Glory Rome Zeus
Glory Rome Zeus - 29.08.2023 18:46

You are like the goodest in python. Herma

Ответить
Satoshi Borishi
Satoshi Borishi - 29.08.2023 12:39

OMG you're so pr3tty! All of a sudden I'm interested in Python 😆😆
Not but seriously good content!

Ответить
Xonirhom
Xonirhom - 29.08.2023 05:27

“Comment”

Ответить
Harloop Manaois
Harloop Manaois - 25.08.2023 06:17

Thank you Mariya

Ответить
RONMEISTER 9000
RONMEISTER 9000 - 16.08.2023 20:08

Not bad .... now frig off barb hahaha 😅😉😉

Ответить
Gurinder Singh
Gurinder Singh - 16.08.2023 00:45

takes a shot every time u hear beautiful...

Ответить
nolyab b
nolyab b - 03.08.2023 16:40

awesome

Ответить
Tomer Borenstein
Tomer Borenstein - 02.08.2023 09:32

Incredible vid!

Ответить
tb
tb - 01.08.2023 01:59

Great videos...all of them. :)

Ответить
sanjay dhage
sanjay dhage - 29.07.2023 06:58

Truly Awesome

Ответить
Karthik Venkataram
Karthik Venkataram - 27.07.2023 07:03

Thanks Mariya. Am new to python coding and this video really helped me learn LIST COMPREHENSIONS.

Just as a small input for all, regarding the example "MyNameIsMaria", we can use .strip() to remove spaces near double quotes.

my_string_ = ("").join([' ' +i if i.isupper() else i for i in my_string]).strip()

Please try and correct me if am worng.

Thank you.

Ответить
Kunal Soni
Kunal Soni - 14.07.2023 21:12

wonderful video

Ответить
Ramesh Silva
Ramesh Silva - 10.07.2023 06:25

👍

Ответить
Susan Thomas
Susan Thomas - 30.06.2023 15:35

Liked the way you explained it step by step and in depth

Ответить
nashipowa maheka
nashipowa maheka - 23.06.2023 23:25

Super_Bits or Beats_By_Dre 😊

Ответить
Roger Priestwell
Roger Priestwell - 21.06.2023 20:06

Of note, IF before the FOR condition should be used if there's an ELSE statement following, however an IF condition alone, should be added before the FOR statement.

Ответить
Kingsley Owusu Ansah
Kingsley Owusu Ansah - 10.06.2023 02:19

Hi Mariya... Recommend to me a python book

Ответить
Jorge Mendoza
Jorge Mendoza - 04.06.2023 00:03

very useful

Ответить
Crystal Avocado
Crystal Avocado - 31.05.2023 23:24

Can I just say that it's so refreshing to have a girl presenter on coding? 😆 Thank you!

Ответить
Kevin Vélez
Kevin Vélez - 27.05.2023 02:51

Cool

Ответить
Matias Alvarez
Matias Alvarez - 24.05.2023 22:10

Hi Mariya

Ответить
William Monday
William Monday - 19.05.2023 22:15

Hi Mariya! Thank you for making the list comprehension tutorial. I was struggling with the concept.

Ответить
PrAsHAnt suthar
PrAsHAnt suthar - 14.05.2023 08:20

it's tricky but works !!!!!! Thanks

Ответить
Emediing Akpan
Emediing Akpan - 08.05.2023 15:28

Please what if I need a special assistant, can't we chat on WhatsApp?

Ответить
KARTHICK RANDOM
KARTHICK RANDOM - 29.04.2023 13:41

Hai Mariya 🖖

Ответить
Carlo Zappacosta
Carlo Zappacosta - 27.04.2023 12:29

I think,
you are very good, you are very beautiful and you are full of advice ... what else?
Awesome :-)

Ответить
Karl Baker
Karl Baker - 20.04.2023 01:51

Thanks!

Ответить
Рома Ивахив
Рома Ивахив - 19.04.2023 09:17

Thanks for tutorial ❤

Ответить
only man
only man - 17.04.2023 07:08

Ответить
Dolly Siharath
Dolly Siharath - 14.04.2023 05:01

Thank you - you're awesome at teaching.

Ответить
Prathap Ramachandran
Prathap Ramachandran - 05.04.2023 06:59

Hi Maria Maria ❤

Ответить
Doug Gordon
Doug Gordon - 02.04.2023 02:49

Thanks Mariya, great video, easy to follow and apply.

Ответить
Kenneth Howell
Kenneth Howell - 28.03.2023 20:40

To bad you do not teach Python for absolute beginners. You are the worlds best teacher as to advanced programming.

Ответить
Notis Tsi
Notis Tsi - 28.03.2023 01:01

wtf is going on in these commends?? I didn't know programmers are that ""stringy"" I liked the video. :)

Ответить