Fight Programmer Procrastination! A Simple Hack From Bevahioral Psychology

How to Overcome Procrastination? Procrastination may easily be the reason number one why you are not reaching your goals. Although there are many flavors of procrastination, a common story may go like this: With good intentions, you set your alarm clock in the evening and expect your future self in the morning to get up, … Read more

Python Return Arguments From Function

πŸ’¬ Question: How to return one or multiple arguments from a Python function? Basically, creating a function that reflects one or more arguments like a mirror: Let’s find out! πŸ‘‡ Method 1: Return Single Argument A function can return a single argument by passing that argument variable after the return keyword. If the argument name … Read more

Python Return Float From Function

Do you need to create a function that returns a float but you don’t know how? No worries, in sixty seconds, you’ll know! Go! πŸ”₯πŸ”₯πŸ”₯ A Python function can return any object such as a float value such as 3.14. To return a float, you can use the built-in float() function or create your own … Read more

Python Convert String List to Uppercase

Coding Challenge πŸ₯‹ πŸ’¬ Question: How to convert a list of strings to all uppercase in Python? Here are three examples: [‘hello’, ‘Python’, ‘world’] to [‘HELLO’, ‘PYTHON’, ‘WORLD’] [‘a’, ‘b’, ‘c’] to [‘A’, ‘B’, ‘C’] [‘aa aa’, ‘bb$bb’, ‘cc()cc’] to [‘AA AA’, ‘BB$BB’, ‘CC()CC’] There are multiple great ways to accomplish this coding challenge and … Read more

Python Convert String List to Lowercase

Coding Challenge πŸ₯‹ πŸ’¬ Question: How to convert a list of strings to all lowercase in Python? Here are three examples: [‘HELLO’, ‘Python’, ‘world’] to [‘hello’, ‘python’, ‘world’] [‘A’, ‘B’, ‘C’] to [‘a’, ‘b’, ‘c’] [‘AA AA’, ‘BB$BB’, ‘CC()CC’] to [‘aa aa’, ‘bb$bb’, ‘cc()cc’] There are multiple great ways to accomplish this coding challenge and … Read more

Python – Split String After K-th Occurrence of Separator

Coding Challenge πŸ’¬ Question: Given a Python string. How to split the string after the k-th occurrence of the separator (string or character)? In other words: how to ignore the first (k-1) separator occurrences when splitting a string? Here are three examples: πŸ‘‰ Related Tutorial: Python Split String After Second Occurrence Solution You can split … Read more

Python – Split String After Second Occurrence of Separator

Coding Challenge πŸ’¬ Question: Given a Python string. How to split the string after the second occurrence of the separator (string or character)? In other words: how to ignore the first separator occurrence when splitting a string? Here are three examples: ‘a-b-c-d-e-f-g-h’ and sep=’-‘ should be split to [‘a-b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’] … Read more

TypeError Built-in Function or Method Not Subscriptable (Fixed)

Overview 🌞 Do you encounter this stupid error? TypeError: ‘builtin_function_or_method’ object is not subscriptable You’re not alone—thousands of coders like you experience this error in thousands of projects every month. This short tutorial will show you exactly why this error occurs, how to fix it, and how to never make the same mistake again. So, … Read more