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.
python-programming-questions
Question 1: Data Types
title: Type Based Output
Implement a function data_operations(variable) that takes input:
1 : An integer .
2 : A floating-point number.
3 : A string .
4 : A list .
5 : A dictionary e where keys are strings and values are integers.
6 : A set.
The function should perform the following do operation on varible:
1 : Multiply the integer a by 2 and return the result.
2 : Add 5.5 to the float b and return the result.
3 : Return the uppercase version of the string c.
4 : Append the integer 10 to the list d and return it.
5 : Add a new key-value pair {"extra": 100} to the dictionary e and return it.
6 : Add the value 99 to the set f and return it.
Return the result as mentioned above.
Question 2: Data Processing
title: process_scores
Implement a function process_scores(scores: list of dictionary) -> dict that takes a list of dictionaries containing scores in different subjects.
Each dictionary is structured like:
Output :
sorted average marks, student dictionary
{'name': 44,'name2':76}
Your function should:
Map each students name to their average score across all subjects.
Return a dictionary with sorted names (keys) and their average scores (values).
Question 3: Data Processing I/O
title: filter_even_numbers
Write a function filter_even_numbers that:
Takes a list of integers as input from stdin.
Prints the sorted list of even integers to stdout.
Question 4: Problem Solving
title: calendar_planner
Implement functions for a mini event management system:
3)remove_event(calendar: dict, date: str, event: str) -> dict: Removes the event from the date. If no events remain on that date, delete the date key.
4)view_calendar(calendar: dict) -> dict: Returns the calendar sorted by date.
Input :
{"calender":{"date1":["event1","event2"]} "ops": [("add", "date3", "event1"), ("add", "date1", "event3"),("remove","date1","event2") ("view", )]}
Output:
{"date1": ["event1", "event3"],"date3" : ["event1"]}
Ques_1.md
Ques_2.md
Ques_3.md
Ques_4.md