[Collection] All Finxter Articles and Tutorials

(Fixed) Python TypeError ‘bool’ object is not subscriptable

5/5 – (1 vote) Problem Formulation Consider the following minimal example where a TypeError: ‘bool’ object is not subscriptable occurs: This yields the following output: Solution Overview Python raises the TypeError: ‘bool’ object is not subscriptable if you use indexing or slicing with the square bracket notation on a Boolean variable. However, the Boolean type … Read more

​Read More
(Fixed) Python TypeError ‘bool’ object is not subscriptable

Python Scrapy – Scraping Dynamic Website with API-Generated Content

5/5 – (2 votes) Scrapy is an excellent tool for extracting data from static and dynamic websites. In this article, we are going to discuss the solution to the following problems: Extract all details of Offices from the website https:/directory.ntschools.net/#/offices Instead of using a whole scrapy framework, use a typical Python script for extracting the … Read more

​Read More
Python Scrapy – Scraping Dynamic Website with API-Generated Content

How to Update Python?

5/5 – (1 vote) Python gets updated roughly once per year with a major update and security fixes. So, Python’s update cycle is 12 months. The end-of-life, i.e., the period during which one Python version is supported, is normally set to 5 years. The following graphic shows a great screenshot of supported and unsupported Python … Read more

​Read More
How to Update Python?

Solidity Boolean and Integer Types – A Helpful Guide with Video

5/5 – (1 vote) Types are among the most important building blocks of a statically-typed programming language, and since Solidity falls into that category, we finally have the opportunity to entertain ourselves with this crucial topic. By learning about types, we’ll get more closely familiar with the Solidity features that are based on idiosyncrasies of … Read more

​Read More
Solidity Boolean and Integer Types – A Helpful Guide with Video

3 Best Ways to Generate a Random Number with a Fixed Amount of Digits in Python

5/5 – (1 vote) Coding Challenge ⚔️ Challenge: Given an integer d representing the number of digits. How to create a random number with d digits in Python? Here are three examples: my_random(2) generates 12 my_random(3) generates 389 my_random(10) generates 8943496710 I’ll discuss three interesting methods to accomplish this easily in Python—my personal favorite is … Read more

​Read More
3 Best Ways to Generate a Random Number with a Fixed Amount of Digits in Python

Python Time Series Forecast – A Guided Example on Bitcoin Price Data

5/5 – (3 votes) A Time Series is essentially a tabular data with the special feature of having a time index. The common forecast task is ‘knowing the past (and sometimes the present), predict the future’. This task, taken as a principle, reveals itself in several ways: in how to interpret your problem, in feature … Read more

​Read More
Python Time Series Forecast – A Guided Example on Bitcoin Price Data

How to Check If a List of ENS (.eth) Domains are Available? (Python)

5/5 – (1 vote) You can check programmatically in Python whether a certain ENS ‘.eth‘ domain name is available by using the urlopen() function from urllib.request module to access the URL ‘https://etherscan.io/enslookup-search?search=example.eth’, replacing the URL suffix ‘example.eth’ with your desired domain. In the following example code snippet, I show how you could check a list … Read more

​Read More
How to Check If a List of ENS (.eth) Domains are Available? (Python)

How to Scrape the Details of 250 Top Rated Movies in Python

5/5 – (3 votes) This article indicates a way to scrape imdb.com/chart/top/, a website that contains 250 numbers of top-rated Movies. This article is solely for educational purposes. 👉 Recommended Tutorial: Web Scraping – Is It Legal? The tool used to extract data from a website is Scrapy, and the software system is UNIX operating … Read more

​Read More
How to Scrape the Details of 250 Top Rated Movies in Python

Python One Line Ternary

5/5 – (1 vote) The most basic ternary operator x if c else y consists of three operands x, c, and y. It is an expression with a return value. The ternary operator returns x if the Boolean expression c evaluates to True. Otherwise, if the expression c evaluates to False, the ternary operator returns … Read more

​Read More
Python One Line Ternary

Solidity File Layout – SPDX License ID and Version Pragmas

5/5 – (1 vote) In the previous articles, we looked at some of the representative examples of smart contracts representing possible real-world scenarios. Our main focus was on capturing the essence of each case, without particular attention given to the general structure, i.e. layout of the respective source files. However, in this mini-series starting with … Read more

​Read More
Solidity File Layout – SPDX License ID and Version Pragmas

Python – How to Find the Longest Substring in Alphabetical Order?

5/5 – (3 votes) Programming Challenge 💬 Challenge: Given a Python string. Find the longest substring for which holds that all of its characters are in alphabetical order so that the first character comes earlier in the alphabet than the second character, and so on. Here are three examples: string: ‘helloworld’, longest substring: ‘ellow’ string: … Read more

​Read More
Python – How to Find the Longest Substring in Alphabetical Order?

Solidity by Example – Understanding Modular Contracts

5/5 – (2 votes) This article continues on the Solidity Smart Contract Examples series and implements an example of a modular contract checking that the balances being sent between the addresses comply with the requirements (docs). We’ll first lay out the entire smart contract example without the comments for readability and development purposes. Then we’ll … Read more

​Read More
Solidity by Example – Understanding Modular Contracts

Combine Images Using Numpy

5/5 – (1 vote) Summary: You can combine images represented in the form of Numpy arrays using the concatenate function of the Numpy library as np.concatenate((numpydata_1, numpydata_2), axis=1). This combines the images horizontally. Use syntax: np.concatenate((numpydata_1, numpydata_2), axis=0) to combine the images vertically. Problem Formulation Consider you have two images represented as Numpy arrays of … Read more

​Read More
Combine Images Using Numpy