This repository contains various functions aimed at achieving specific learning outcomes in programming. The functions are designed to handle basic mathematical operations, data processing, and performance evaluation.
To get started with your own modifications, please follow these steps:
- Fork the Repository: Click on the "Fork" button at the top right of this page to create a copy of the repository in your own GitHub account.
- Clone the Repository: Use the following command to clone your forked repository to your local machine:
Replace
git clone https://github.com/your-username/repository-name.gityour-usernamewith your GitHub username andrepository-namewith the name of the repository. - Navigate to the Directory: Change into the directory of the cloned repository:
cd repository-name
- sum_of_squares(n: int): Calculates the sum of the squares of all integers from 1 to n.
- evaluate_performance(grades: list, min_pass: int): Evaluates student performance based on grades and a minimum passing grade.
- calculate_cumulative_performance(scores: dict): Computes the average score and identifies subjects with below-average scores.
- analyze_improvement(scores: list): Analyzes the trend of improvement based on a list of scores.
- rank_students(students: list[tuple[str, int]]): Ranks students based on their scores.
- even_numbers(n: int): Generates a list of even numbers from 1 to n.
- odd_numbers(n: int): Generates a list of odd numbers from 1 to n.
- sum_multiples_of_num(num: int, length: int): Calculates the sum of multiples of a given number up to a specified length.
- skip_num(n: int, length: int): Generates a list of numbers from 1 to length, skipping a specific number.
- break_test(n: int, length: int): Generates a list of numbers from 1 to length, stopping when a specific number is encountered.
- sum_numbers_until_zero(nums: list): Sums numbers in a list until a zero is encountered.
- count_positive_numbers(nums: list): Counts the number of positive integers in a list.
- sum_dictionary_values(dictionary: dict): Sums all values in a dictionary.
- sum_unique_elements(elements: list): Sums unique elements in a list.
- skip_divisible_by_num(n: int, length: int): Generates a list of numbers from 1 to length, skipping those divisible by a specific number.
- square_numbers(nums: list): Calculates the square of each number in a list.
- transform_string(input: str, transform: str): Transforms a string based on the specified transformation type (capitalize, upper, lower).
- sum_and_average(nums: list[int]): Calculates the sum and average of a list of numbers.
- word_frequency_count(words: list[str]): Counts the frequency of each word in a list.
- filter_even_numbers(nums: list[int]): Filters out even numbers from a list.
The code is accompanied by a comprehensive suite of unit tests that validate the functionality of each implemented function. The tests cover various scenarios, including edge cases and performance evaluations.
To run the tests, use the following command: