Skip to content

micanipho/Practice-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Student Code

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.

How to Complete

To get started with your own modifications, please follow these steps:

  1. 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.
  2. Clone the Repository: Use the following command to clone your forked repository to your local machine:
    git clone https://github.com/your-username/repository-name.git
    
    Replace your-username with your GitHub username and repository-name with the name of the repository.
  3. Navigate to the Directory: Change into the directory of the cloned repository:
    cd repository-name
    

Functions Overview

Learning Outcome: Functions

  • 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.

Learning Outcome: Basic Loops

  • 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.

Learning Outcome: Processing Data

  • 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.

Testing

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:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages