Skip to main content

A package for basic list operations and algorithms.

Project description

Algorithmetn

Algorithmetn is a Python package designed for basic list operations and algorithms. It provides a collection of static methods that simplify common tasks such as displaying messages, managing lists, and performing mathematical operations.

Features

  • Display Messages: Easily print messages to the console.
  • User Input: Get input from users in various formats (string, integer, float).
  • List Management: Create, modify, and query lists with methods for adding, removing, and searching items.
  • Mathematical Operations: Calculate maximum, minimum, average, and check for perfect cubes.
  • Conditional Execution: Execute actions based on conditions.

Methods

Static Methods

  • afficher(message): Display a message.
  • entrer(prompt): Get user input.
  • liste(): Return an empty list.
  • ajouter(l, item): Add an item to the list.
  • retirer(l, item): Remove an item from the list if it exists.
  • existe(l, item): Check if an item exists in the list.
  • longueur(l): Return the length of the list.
  • position(l, item): Return the index of an item or -1 if not found.
  • vider(l): Clear the list.
  • clone(l): Return a copy of the list.
  • entier(prompt): Get an integer input from the user.
  • reel(prompt): Get a float input from the user.
  • pour(n, action): Execute action for each number from 0 to n-1.
  • si(condition, action_vrai, action_faux=None): Conditional execution based on a boolean condition.
  • maximiser(l): Return the maximum value in the list.
  • minimiser(l): Return the minimum value in the list.
  • moyenne(l): Return the average of the numbers in the list.
  • trier(l): Sort the list in ascending order.
  • rechercher(l, item): Search for an item and return its index or -1 if not found.
  • inverser(l): Reverse the list.
  • est_vide(l): Check if the list is empty.
  • est_palindrome(chaine): Check if the input is a palindrome (string or list).
  • est_cubique(n): Check if a number is a perfect cube.

Usage Example

from Algorithmetn import Algorithmetn

# Create a new list
ma_liste = Algorithmetn.liste()

# Add items to the list
Algorithmetn.ajouter(ma_liste, 'apple')
Algorithmetn.ajouter(ma_liste, 'banana')

# Display the list
Algorithmetn.afficher(ma_liste)

# Check if an item exists
if Algorithmetn.existe(ma_liste, 'apple'):
    Algorithmetn.afficher('Apple is in the list!')

# Get the length of the list
length = Algorithmetn.longueur(ma_liste)
Algorithmetn.afficher(f'List length: {length}')

# Check for a palindrome
is_palindrome = Algorithmetn.est_palindrome('radar')
Algorithmetn.afficher(f'Is "radar" a palindrome? {is_palindrome}')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

algorithmetn-0.4.3.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

algorithmetn-0.4.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file algorithmetn-0.4.3.tar.gz.

File metadata

  • Download URL: algorithmetn-0.4.3.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for algorithmetn-0.4.3.tar.gz
Algorithm Hash digest
SHA256 e49d96fd54e90a8e90fb7c09773163b78cbe5b68e8ee1bc3987019cabe9a376d
MD5 a8a2785b7a7069e8662058e3beeb358e
BLAKE2b-256 48960620e3b390c595e534513260ca98431419f3d02ce1ea76dc3d2a11e18de3

See more details on using hashes here.

File details

Details for the file algorithmetn-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: algorithmetn-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for algorithmetn-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6ced087e8338378988a1033660740af8d121bc26455dd45f63ff3568ba755d88
MD5 394f846a7243840fc4e41edcb26b706c
BLAKE2b-256 6604051ca43242b2ff4a0b3bc8af72541ddd8ff3eddfcff5f9867159e9016c62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page