Gradient Descent in Neural Nets – A Simple Guide to ANN Learning

πŸ’‘ Gradient Descent: What is it? Where does it come from? And what the heck is it doing in my ANN? You can scroll through the slides as you watch this video here: This article aims to present the gradient descent algorithm in a light fashion, familiarizing new Machine Learning enthusiasts with this fundamental technique… … Read more

How to Check if a Python Set is Empty?

There are three main ways to check if a set is empty: Implicit: Pass the set into a Boolean context without modification. Python will automatically convert it to a Boolean using bool(). Explicit: Pass the set into the bool() Function. Comparison: Compare the set with the empty set like so: my_set == set() Let’s dive … Read more

How to Shuffle Two Arrays in Unison in Python?

Problem Formulation Given two arrays of the same length but different orders. How will you shuffle the two arrays in unison? Shuffling two arrays in unison means reordering the elements of both arrays in the same pattern. Let’s understand this with the help of an example. Example: Given:arr_1 = [[1, 1], [2, 2], [3, 3]]arr_2 … Read more

How to Find the Longest String in a Python Set?

Use Python’s built-in max() function with the key argument to find the longest string in a set. Call max(my_set, key=len) to return the longest string in the set using the built-in len() function to determine the weight of each stringβ€”the longest string has maximum length. πŸ‘‰ Recommended Tutorial: How to Find the Longest String in … Read more

How to Apply a Function to a Python List

Problem Formulation and Solution Overview This article will show you how to apply a function to a List in Python. To make it more interesting, we have the following running scenario: As a Python assignment, you have been given a List of Integers and asked to apply a function to each List element in various … Read more

How to Find the Longest String in a Python Dictionary?

You’ll never guess the most concise way to solve this problem… πŸ¦„ Coding Challenge πŸ’¬ Challenge: Given a dictionary with string keys. Get the string key with the maximum number of characters, i.e., the longest string. A variant of this problem is to get the length of the longest string — I’ll give you a … Read more

How to Find a Partial String in a Python List?

Problem Formulation πŸ’¬ Challenge: Given a Python list of strings and a query string. Find the strings that partially match the query string. Example 1: Input: [‘hello’, ‘world’, ‘python’] and ‘pyth’ Output: [‘python’] Example 2: Input: [‘aaa’, ‘aa’, ‘a’] and ‘a’ Output: [‘aaa’, ‘aa’, ‘a’] Example 3: Input: [‘aaa’, ‘aa’, ‘a’] and ‘b’ Output: [] … Read more

Top 5 Solidity Smart Contract Examples for Learning

In this smart contract collection, you’ll dive the most insightful Solidity examples for learning and polishing your skills as a Solidity developer and Blockchain engineer. You can also use those as templates when creating your own smart contracts. Stand on the shoulders of giants! πŸ¦„ 🌍 Recommended Tutorials: Before diving into any individual example in … Read more

Mastering the Solidity Blind Auction Contract (Example)

This article continues on the Solidity Smart Contract Examples series, which implements a somewhat more complex process of a blind auction. 🌍 Recommended Tutorial: Smart Contracts with Solidity — Crash Course Here, we’re walking through an example of a blind auction (original source). We’ll first lay out the entire smart contract example without the comments … Read more

Python TypeError ‘set’ object is not subscriptable

Minimal Error Example Given the following minimal example where you create a set and attempt to access an element of this set using indexing or slicing: If you run this code snippet, Python raises the TypeError: ‘set’ object is not subscriptable: Why Does the Error Occur? The Python TypeError: ‘set’ object is not subscriptable occurs … Read more