Update block docs for: iteration.md

This commit is contained in:
Bently
2025-01-10 12:54:48 +00:00
parent ba9c91d0b7
commit f125bb658c

View File

@@ -0,0 +1,45 @@
## Calculator Block
### What it is
A mathematical calculation tool that performs basic arithmetic operations between two numbers.
### What it does
Performs one of five mathematical operations (addition, subtraction, multiplication, division, or power) on two numbers and provides the result. It can also optionally round the result to the nearest whole number.
### How it works
The block takes two numbers and a selected operation, processes them according to the chosen mathematical operation, and returns the result. It includes safety features to handle special cases like division by zero.
### Inputs
- Operation: Choose from Add, Subtract, Multiply, Divide, or Power operations
- First Number (A): The first number in the calculation
- Second Number (B): The second number in the calculation
- Round Result: Option to round the final answer to the nearest whole number
### Outputs
- Result: The numerical outcome of the mathematical operation
### Possible use case
A budgeting application where users need to perform various calculations, such as adding expenses, calculating percentage increases, or dividing costs among multiple people.
## Count Items Block
### What it is
A counting tool that determines the number of items in various types of collections.
### What it does
Counts the total number of elements in a given collection, whether it's a list of items, characters in a text, or key-value pairs in a dictionary.
### How it works
The block analyzes the provided collection and counts its elements. It can handle various types of collections including lists, strings, dictionaries, and other iterable objects. If it encounters an invalid input, it returns -1 to indicate an error.
### Inputs
- Collection: The group of items you want to count (can be a list, dictionary, string, or any other collection of items)
### Outputs
- Count: The total number of items found in the collection
### Possible use case
An inventory management system where users need to quickly count items in different categories, or a text analysis tool that needs to count elements like words in a sentence or items in a shopping cart.