Разбираем map, filter, reduce, any, all, zip и enumerate в Python

Все мы начинали писать на Python примерно одинаково: создавали пустой список, запускали цикл for, проверяли условие через if и делали .append(). Это надежно, предсказуемо, но по мере роста кодовой базы такие конструкции начинают утомлять — мы тратим 4-5 строк на банальную трансформацию данных, которую можно уложить в одну лаконичную строку. В этой статье мы подробно разберем встроенный инструментарий Python для работы с итерируемыми объектами: map, filter, reduce, any, all, zip и enumerate.

https://habr.com/ru/articles/1036696/

#python #map #filter #reduce #функциональное_программирование #генераторы_списков #ленивые_вычисления #рефакторинг_кода

Разбираем map, filter, reduce, any, all, zip и enumerate в Python

Все мы начинали писать на Python примерно одинаково: создавали пустой список, запускали цикл for , проверяли условие через if и делали .append() . Это надежно, предсказуемо, но слишком громоздко. По...

Хабр

Here's yet another tech repurposing/recycling post!  

This USB SD card reader was DIY'd from a component I found in a trashed laptop someone had discarded and left on the side of a bin!

The laptop's SD reader daughterboard was really just an USB device connected to one of the motherboard's internal USB ports via a ribbon cable. So, after figuring out which pin is which, desoldering that ribbon cable and replacing it with a regular USB one, as one would expect, effectively turned it into an external SD card reader

At that point all I had to do was to find a case for it: I don't have a 3D printer, but trimming the board slightly and removing the plastic stands made it fit perfectly into this SD card holder, which does the job and is rather small all things considered!

(And yes, the irony of using an SD card holder as its case isn't lost on me!  )

#tech #technology #usb #repair #reduce #reuse #repurpose #recycle #sd #modding

Slapped a rubber grommet in there, tightened a bit, and voila! We’ve got a makeshift (non-leaking) recycled birdbath!
#garden #gardening #landman #birdbath #diy #reduce #reuse #recycle #ReduceReuseRecycle

lol. This is what happens when appliances are repaired and light fixtures are replaced by someone who hates to put things into landfills: a potential redneck birdbath 🤣

Used the failed agitator from our washing machine and the hideous light fixture from the previous owners. Accidentally cracked the glass so we’re going to set it outside for a few days and see what happens.

#diy #reduce #reuse #recycle #ReduceReuseRecycle #birdbath

MPs, senators to reduce U.S. exchange travel amid trade negotiations
MPs and senators are set to drastically reduce interparliamentary exchanges with the U.S. Senate and Congress, despite efforts to save a crucial trade deal with the United States.
#Canada #Economy #USNews #cusma
https://globalnews.ca/news/11843858/canada-us-trade-negotiations/
MPs, senators to reduce U.S. exchange travel amid trade negotiations
MPs and senators are set to drastically reduce interparliamentary exchanges with the U.S. Senate and Congress, despite efforts to save a crucial trade deal with the United States.
#Canada #Economy #USNews #cusma
https://globalnews.ca/news/11843858/canada-us-trade-negotiations/
MPs, senators to reduce U.S. exchange travel amid trade negotiations
MPs and senators are set to drastically reduce interparliamentary exchanges with the U.S. Senate and Congress, despite efforts to save a crucial trade deal with the United States.
#Canada #Economy #USNews #cusma
https://globalnews.ca/news/11843858/canada-us-trade-negotiations/
MPs, senators to reduce U.S. exchange travel amid trade negotiations
MPs and senators are set to drastically reduce interparliamentary exchanges with the U.S. Senate and Congress, despite efforts to save a crucial trade deal with the United States.
#Canada #Economy #USNews #cusma
https://globalnews.ca/news/11843858/canada-us-trade-negotiations/

Women’s scoop neck T-shirt, reduce, repair, reuse, recycle

Scientist and Philosopher’s third design on reducing consumption and loading on the environment.

Our environmental and exploitative footprint of the Earth’s nature and natural resources and of other human beings is destroying the very fabric by which we live and depend on. Yet countless numbers of individuals especially in first world countries are either ignorant or just don’t care about the damage caused by their lifestyles. (S&P) 

Check out how these products are made using organic cotton. We need to live in not just a sustainable way but one that causes the least environmental loading on the planet. You can even send these items back to be made into new things when you have finished with them.

This women’s scoop neck T-shirt is available from our Teemill store, https://scientistandphilosopher.com/product/women-s-scoop-neck-reduce-repair-reuse-recycle-t-shirt-v3b/. The design is also available on a unisex T-shirt.

Women’s scoop neck reduce, repair, reuse, recycle T-shirt V3B

Our Teemill organic cotton products are ethically, environmentally and ecologically produced. They are recyclable, sustainable, stylish, high quality fashion items.

Our links

Our Teemill shop site for our organic cotton clothes and bags, https://scientistandphilosopher.com/.

My author page where you can discover more about my books, https://www.amazon.co.uk/-/e/B07D3ZTQ1L.

Our Etsy shop, https://junagarhmedia.etsy.com/.

This is our website for all our photography and my books, https://www.junagarhmedia.co.uk/.

We are also on Flickr, https://www.flickr.com/photos/21104365@N06/.

Also on Instagram, https://www.instagram.com/junagarh_media/.

On Pinterest, https://www.pinterest.co.uk/paulpaddington2017/

#ethical #environmental #ecological #recyclable #sustainable #stylish #quality #fashion

#ecological #environmental #Ethical #Fashion #quality #recyclable #Recycle #Reduce #Repair #Reuse #ScientistAndPhilosopher #Stylish #Sustainable #Teemill