Python








Introduction

One alternative to MATLAB, Mathematica and Maple is to use SageMath. SageMath is build on open source programming language Python. There is a cloud based system cloud.sagemath.com [[https://cocalc.com ]]. In this course, we describe the use of 3 lightweight Python libraries:

  1. [Sympy]- Symbolic mathematics with Sympy.ipynb) for carrying out symbolic mathematical calculations;
  2. [Numpy]- Linear algebra with Numpy.ipynb) for dealing with large numeric arrays: perfect for linear algebra;
  3. [Pandas]- Data analysis with Pandas.ipynb) a brilliant tool for data analysis.
Python and the above libraries are all free to use (and potentially change if you needed to!).


Variable

  
# Anything after a `#` will be ignored. This is what we call a 'comment'
a = 20  # Assigning a value to a
b = 21  # Assigning a value to b
a * b  # Calculating the product of a and b
a / (a + b)  # Calculating a / (a + b)
a ** b  # Calculating a raised to the power of b



Function

  
def proportion(a, b):
    """
    We can use triple " to describe what our function does.
    
    Here for example: we're creating a function to calculate 
    the proportion of a of a + b
    """
    return a / (a + b)
proportion?
proportion(3, 1)
 



Function

Repeating things with for loops
We can use a for loop to repeat bits of code with Python.
For example the following will calculate:
\[ \displaystyle \sum_{i=1}^9 i \]
  
total = 0
for i in range(10):
    total = total + i
total
 

2 comments:

  1. The hands-on pairing session with the Restful-Booker platform provides a useful example of setting up and testing a REST-based application while working through real environment and dependency challenges. Checking Node, NPM, Maven, and JDK versions, updating the pom.xml files, resolving build failures, and successfully running the application locally demonstrates the practical troubleshooting involved in API testing. A Python Online Course can also help build the programming foundation needed for automation and testing work.

    ReplyDelete
  2. Another valuable part of the session was the collaborative debugging process, where configuration differences between Windows and Mac created additional challenges before the services could be built and executed successfully. The experience shows why systematic environment checks and hands-on troubleshooting are important when working with API testing projects. Learners looking to strengthen their programming skills for similar automation tasks can explore a Python Online Training.

    The project also demonstrates how a practical REST application can become a useful foundation for experimenting with automated testing, service setup, and end-to-end test execution. Working with multiple services, Maven builds, Node dependencies, and local execution provides valuable project-based experience. Students interested in applying Python to practical technical projects can find related ideas through Python Projects For Final Year.

    ReplyDelete