Question
Q1: Create two functions (generate_data and process_data) in python, where: - generate_data function will generate a sequence list from a random integer number based on
Q1: Create two functions (generate_data and process_data) in python, where:
- generate_data function will generate a sequence list from a random integer number based on the following specifications:
- The function inputs are Length of list, start and end random number.
- process_data function will process the input list data into this function to produce new output based on the following specifications:
The function inputs are data_list as a sequence list, operation_type as a string.
There will be three operations type:
Sorting, this will return an ascending sorted list
Max, this will return the maximum value in the input list
Min, this will return the minimum value in the input list
Note:
1- You need to show the output result for operation type. For example, sorting, max, and min.
2- You can use this command to generate random number
from random import randrange randrange(0, 13) #this will generate Integer from 0 to 13 inclusive
3- You can use below command to generate the current date:
from datetime import date date.today().strftime(%b %d, %Y)
Q2: Create a program that initial a sequence list of dictionaries as below:
Name Age Length
Tom 19 80
John 20 90
Jony 17 91
Mick 15 88
Donal 16 89
David 21 85
This program has three functions in process module and these modules are:
- sorting_by_name, this will return a sorted list dictionary based on the name
- sorting_by_length, this will return a sorted list dictionary based on the length
- sorting_by_age, this will return a sorted list dictionary based on the age
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started