Author: Mohammed Abualrob

Python recursive function examples

Table of contents Recursive exponential Recursive max Recursive multiplication Recursive sum Recursive average Recursive uppercase Recursive exponential Given two exponential numbers with the same base, the multiplication is another exponential number with the same base but we add the exponents. We can utilize this observation and define a recursive exponential formula. If (n) is even

Minimal Python web server

Introduction There are various ways to implement a minimal Python web service or server. It can be easily implemented using the web.py python web framework. First, you need to install the library. Open a terminal and execute the following command… Provide the password when requested. If the installation goes smoothly, create a Python script and

Difference between pass by value and pass by reference in Python

Introduction In Python, this question can be tricky specially if you come from a C++ background where pass by value and pass by reference is well defined. So what does that mean in Python? This question is repeatedly asked and answered online. My take on that is through the following example… Define 4 data types