pydata example documentation#
Add your content using reStructuredText syntax. See the
reStructuredText
documentation for details.
Module example#
This is the main module of our application. It contains functions for basic arithmetic operations.
- class main.Calculator(initial_value=0)#
Bases:
objectA simple calculator class.
- Parameters:
initial_value (
int|float) – The starting value for calculations.
- multiply(x)#
Multiplies the current value by x.
- Parameters:
x (
int|float) – The number to multiply by.- Return type:
int|float- Returns:
The new current value.
- main.add(a, b)#
Adds two numbers and returns the sum.
- Parameters:
a (
int|float) – The first number.b (
int|float) – The second number.
- Return type:
int|float- Returns:
The sum of a and b.
- Raises:
TypeError – If a or b are not numbers
- main.example(expected_letters, text)#
This is an example function
It computes the ratio of the length of a text and the expected number of letters.
- Parameters:
expected_letters (
int) – how many letters are expectedtext (
str) – the text which is testes
- Return type:
ratio of the length of the text and the expected number of letters
- main.main()#