Lukas

The Ultimate Guide To Python Tuples

Python has several built-in data structures such as Lists, Sets and Dictionaries (check out the articles!).In this article, you’ll learn everything you need to know about tuples including real world examples. Tuple Motivating Example Did you ever have a function from which you wanted to return several values? Say, you’ve got a function translate(text, target_language) …

The Ultimate Guide To Python Tuples Read More »

Python Freelancing: My First Fiverr Gig and How I Solved It

Basic Webscraping Script in Python | Requests | BeautifulSoup | ArgParse Sold Gig ($35) This is the gig description I offered on my profile to get my first gig: An email marketing company hired me to write a Python script that satisfies the following requirements. Requirements What is the input? (file, file type, email, text,…) …

Python Freelancing: My First Fiverr Gig and How I Solved It Read More »

How to Get Specific Elements From a List? – Most Pythonic Way!

Quick Article Summary to get a specific element from a list: Get elements by index use the operator [] with the element’s index use the list’s method pop(index) use slicing lst[start:stop:step] to get several elements at once use the function itemgetter() from the operator module Get elements by condition use the filter() function use a …

How to Get Specific Elements From a List? – Most Pythonic Way! Read More »

How to Split a List Into Evenly-Sized Chunks?

In this article, I’ll show you how to divide a list into equally-sized chunks in Python. Step-by-step, you’ll arrive at the following great code that accomplishes exactly that: You can play around with the code yourself but if you need some explanations, read on because I’ll explain it to you in much detail: Chunking Your …

How to Split a List Into Evenly-Sized Chunks? Read More »