Skip to content

Questions by Chandan#25

Open
23f1003124 wants to merge 9 commits intolivinNector:mainfrom
23f1003124:main
Open

Questions by Chandan#25
23f1003124 wants to merge 9 commits intolivinNector:mainfrom
23f1003124:main

Conversation

@23f1003124
Copy link

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

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

  1. Problem Solving
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant