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

How to Disable Security Certificate Checks for Requests in Python

Summary: You can disable security certificate checks for requests in Python in two ways: (i) Using Session.verify as False (ii) Setting verify = false inside the request method. Problem Formulation Problem Statement: How to disable security certificate checks for requests in Python? The requests module in Python sends HTTP requests using a specific method to … Read more

Python | Split String into Characters

Summary: Use list(“given string”) to extract each character of the given string and store them as individual items in a list.Minimal Example:print(list(“abc”))# OUTPUT: [‘a’, ‘b’, ‘c’] Problem Formulation Problem: Given a string; How will you split the string into a list of characters? Example: Let’s visualize the problem with the help of an example: input … Read more

How to Read the First Line of a File in Python

Problem Formulation and Solution Overview This article will show you how to read and display the first line of a file in Python. For this article, we will work with a flat-text file containing five (5) possible things to do during your lifetime. This file is saved to bucket_list.txt and placed into the current working … 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