Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Data_type1
It covers various basic data type-related programming problems. Below are the problem statements and their corresponding functions:
a. float_truncate(d): Accepts a float and truncates it to an integer, removing the decimal part.
b. is_it_integer(d): Accepts any data type and returns a boolean indicating whether the input is an integer.
c. Reverse_str(s): Accepts a string and returns the reversed version of the string without using loops.
d. Max_set(s): Accepts a set and returns the maximum element from the set.
e. List_sum(l): Accepts a list and returns the sum of all elements in the list without using loops.
f. Dict_keys_find(d): Accepts a dictionary and returns a list of all the keys in the dictionary.
Basic Data Type Processing
Covers basic data processing tasks, which include operations like squaring numbers, filtering and aggregating values based on a threshold, sorting strings, and grouping items by their keys.
Functions Implemented:
square_numbers(d: list) -> list
Given a list of numbers, returns a new list with each number squared.
filter_aggregation(d: list, k: int) -> int
Given a list of numbers and a threshold k, returns the sum of numbers greater than or equal to the threshold.
sort_strings(d: list) -> list
Given a list of strings, returns a new list with strings sorted alphabetically.
group_by_key(d: list) -> dict
Given a list of tuples (key, value), returns a dictionary where the keys map to lists of corresponding values.
3.Data Processing I/O
Covers processing tasks like filtering, sorting, summing, and grouping. The functions work with lists of data and output the results to the console
It is about an Order Management System for a small business. The system should consist of the following operations:
Add an Order: This operation adds a new order to the list of orders, containing details like the order ID, product name, and quantity.
Update an Order: This operation updates the quantity of an existing order. If the order ID doesn't exist, an error message should be returned.
Delete an Order: This operation removes an order from the list based on the order ID. If the order ID is not found, it returns an error message.
Generate Order Summary: This operation calculates and returns a summary of the orders, grouped by product, showing the total quantity ordered for each product.