Define a function named create_usernames_dictionary (usernames_list) which takes a list of usernames as a parameter and creates a dictionary. The keys consist of integers and the values are lists of unique usernames where the last digit of each username is equal to the key value. The lists of unique words must be in sorted alphabetical order. Note: A username contains 3 or 4 letters followed by 3 digits. You can assume the list is not empty. For example: Test Result = a_list ['dsmi001', 'dsmi023', 'pwong002', 'kng126', 'mgra734', 'bcar735', 'dng134¹] [] a_dict = create_usernames_dictionary (a_list) 1 ['dsmi001'] for key in sorted (a_dict): 2 ['pwong002¹] print(key, a_dict [key]) 3 ['dsmi023'] 4 ['dng134', 'mgra734'] 5 ['bcar735¹] 6 ['kng126¹] 7 [] 8 [] 9 [] Answer: (penalty regime: 0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50 %) Reset answer 1-def create_usernames_dictionary (usernames_list): 2 result dict = (0:1, 1:1, 2:1, 3:1, 4:1, 5:1, 6:1, 7:11, 8:11, 9:11}
Q: Examine the advantages of agile development versus more traditional methods.
A: Types of terrorism definitions: The illegal use or threat of violence to intimidate the population…
Q: (10) to Convert the grammar SaAA Aas / 65/a to a PDA that accepts the Same language by enity stack…
A: PDA is also known as pushdown automata.
Q: Question 1 How is the static_cast operator different from the dynamic_cast operator?
A: The Answer is in given below steps
Q: Question 3 What problems might the following nested class declaration have? class Ribs { private:…
A: The question is to find the problem using the nested class.
Q: How far has technology come in the last several decades, and what are the many kinds of technical…
A: The level of innovation brought about by technology: If new ideas are not implemented, the world has…
Q: Python(multiple linear regression using Ordinary Least Square method) Question: Implement multiple…
A: Given that: Predict whether or not the passenger survived the sinking of the Titanic. See below…
Q: Consider utilizing structured language when trying to describe processes that do not need systems…
A: Introduction: Structured Analysis is a technique of development that use diagrams as a means of…
Q: Explain what the word "user interface" means. Differentiate between graphical user interfaces…
A: User interface The user interface, sometimes known as the UI, is the medium via which the user and…
Q: run a loop for a from 0 to 9999 ● see (a+"").length() , if it is k, then add (4-k) zeores before…
A: We need to write a program for the given scenario. The language used is Java.
Q: My understanding of multifactor authentication is limited at best. What role does it play in…
A: Multifactor authorization: Is a type of security that checks if a person is allowed to log into an…
Q: Write below python problem Print cube (^3) of all numbers in range 1 to 10
A: HI THEREI AM ADDING ANSWER BELOWPLEASE GO THROUGH ITTHANK YOU
Q: Discuss the hosted software paradigm for corporate software and investigate the primary allure it…
A: Electronic connectivity is the most important factor for fostering team development.
Q: A discussion of the consequences that the use of new technologies and their proliferation have for…
A: Issues of social and ethical concern Making the transition to rising growth trends: Multinational…
Q: In what ways, therefore, is it distinct from what we now understand to be the internet of things?…
A: Let's see about the internet of things, Internet of things IOT or internet of things are the network…
Q: Make a list of the differences between dynamic programming and divide-and-conquer.
A: Your answer is given below.
Q: The best access point (AP) recognized by your device in terms of the quality of the received signal…
A: The MAC address of your route is recorded on the sticker on the bottom half of the passageway. is…
Q: write the following uml in java
A: Please upvote. I am providing you the correct answer below. Please please please.
Q: Both a false positive and a false negative were reported. Authentication based on biometric…
A: The following are the differences between false positive and false negative biometric…
Q: What do we do first? What are the many types of cyber assaults, and what precisely is a cyber…
A: Answer:
Q: What part do you think artificial intelligence will play in your life in the future? Where do you…
A: Introduction: Artificial intelligence (AI) is the simulation of human intelligence processes by…
Q: Assume that a 10 m high structure is observed from a distance of 50 m. What is the size of the…
A: Below is the answer to above question. I hope this will meet your requirement.
Q: The use of computers is what led to this result. How can we prove that computer use has become much…
A: Answer to the given question: Computers have fundamentally altered the manner in which we work, be…
Q: What do you consider to be one of the most significant uses of AI in the working world today? Have a…
A: Artificial Intelligence Examples: Putting together robots. Autonomous cars. Smart assistants.…
Q: What is the difference between evolutionary prototyping and open-source development?
A: Introduction: Open-source software (OSS) is computer software published under a license that permits…
Q: An organized collection of values that may be used for data together with a set of operations that…
A: An organized collection of values that may be used for data together with a set of operations that…
Q: Calculate and print the shaded area for the given rectangle below in function shadedArea () . Height…
A: c++ Program #include <bits/stdc++.h> using namespace std;double rectangleArea(double…
Q: Which sorts of printers are eligible to have their own unique IP addresses?
A: A printer is a hardware output device that is used to print any document. It accepts input command…
Q: Which kind of simulated intelligence are available to choose from? Describe the many applications of…
A: Artificial intelligence is classified into two types: AI Types based on Capabilities AI Strict:- It…
Q: Question 2 What is the output of the following code: int main() { test1(); test1(); return 0; } void…
A: Find the required answer with explanation given as below :
Q: What procedures are required to install software on a local computer, a portable device, or a web…
A: The above question is solved in step 2:-
Q: 2. Write a java program that asks the user to type a positive number n and prints the series using…
A: In this question we have to write a JAVA program in which we will take the input from the user for a…
Q: When compared to the traditional system development lifecycle, how effective is agile methodology?
A: We need to discuss, how effective is agile methodology when compared to the traditional system…
Q: 5. A positive whole number n > 2 is prime if no number between 2 and √n (inclusive) evenly divides…
A: Ans:) In this problem we need to create a program to verify a given number is prime number or not.…
Q: The term "digital signature" refers to what? What sets a digital signature from from an electronic…
A: Given: A digital signature is an electronic version of a signature that may be used to verify the…
Q: Investigate both the positive and negative aspects associated with the different system models.
A: Introduction: System modelling creates abstract models of a system, each with a unique vision.…
Q: What exactly is it that you want to achieve with the help of artificial intelligence (AI)? Please…
A: Artificial intelligence : Individual labor is improved by artificial intelligence in terms of speed,…
Q: What future influence will artificial intelligence have? What artificial intelligence-based software…
A: The use of computer-aided reasoning (CAI): An area of research known as artificial intelligence (AI)…
Q: Solving using DFs on this graph
A: Given :- In the above question, the directed graph is mention in the above given question Need to…
Q: The implementation and maintenance of web applications may give rise to a variety of challenges.
A: Introduction: The following are the difficulties that must be addressed during the deployment and…
Q: Please provide examples of each kind of application software and explain the distinctions between…
A: Start: Application software fulfils a particular educational, personal, or commercial role. Each…
Q: What do you consider to be the most significant purpose that a firewall was developed to serve? At…
A: Significant purpose: A strong mission transcends what your organisation performs. Instead of merely…
Q: Write c program to calculate answer of below expression x²+5x+6 Ask user for value of x
A: c program to calculate answer of below expression x²+5x+6 Ask user for value of x
Q: Which sorts of printers are eligible to have their own unique IP addresses?
A: Introduction: The ability to print a network configuration page, which often contains the printer's…
Q: In the following, choose all statements which are true regarding the application of software quality…
A: a. Tests should include cases where more than unique id is used for same item of inventory. b.…
Q: What exactly are the principles of computer graphics when it comes down to it?
A: Computer graphics: The skill of creating visuals on computer displays via the use of programming is…
Q: Model checking approaches may be effectively applied in many domains, and security protocols are an…
A: Introduction: Model checking approaches may be effectively applied in many domains, and security…
Q: Answer below question using poyla's four step Find 45% of 125
A: HI THEREI AM ADDING ASNWER BELOW PLEASE GO THROUGH ITTHANK YOU
Q: Do you think that it is possible to create a fake RSA-based digital signature? Whether you agree or…
A: Answer to the given question: Note that this bites me even if I separately check that the total…
Q: How do you react when you see complete strangers pleading for donations online?
A: GIVEN: How do you react when you encounter requests for financial support or medical assistance made…
Q: Discuss the artificial intelligence techniques critically. Give specific instances to support your…
A: Introduction: Artificial intelligence (AI) pertains to intelligence exhibited by machines instead of…
Python question, need some help
Step by step
Solved in 3 steps with 1 images
- (PYTHON) a) get_total_cases() takes the a 2D-list (similar to database) and an integer x from this set {0, 1, 2} as input parameters. Here, 0 represents Case_Reported_Date, 1 represents Age_Group and 2 represents Client_Gender (these are the fields on the header row, the integer value represents the index of each of these fields on that row). This function computes the total number of reported cases for each instance of x in the text file, and it stores this information in a dictionary in this form {an_instance_of_x : total_case}. Finally, it returns the dictionary and the total number of all reported cases saved in this dictionary. (Suppose we want to know the total number of cases reported on each date, so use x = 0.) >>> result, total_cases = get_total_cases(database, 0) >>> display_dict(result) 2021-05-19: 8 2021-05-20: 2 2021-05-21: 1 2021-05-22: 1 >>> print(total_cases) 12PYTHON prov_records_per_date() takes a 2-D list (similar to the database) and an integer representing the province ID. This function returns another 2-D list, where each element of this list stores information in the following format. [ [day1, total number of patients (both icu and non-icu) in this provice reported in day1], [day2, total number of patients (both icu and non-icu) in this provice reported in day2], ... ] >>> results = prov_records_per_date(database, 35) >>> display_dict(result) >>> display_list(result) ['2022-01-31', 239] ['2022-02-05', 393] >>> results = prov_records_per_date(database, 10) >>> display_dict(result)['2022-02-02', 225] >>> results = prov_records_per_date(database, 81) >>> display_dict(result)No data in listComplete the below function that takes a file name and a list as arguments andreads the text within the corresponding file, then creates a dictionary whosekeys are the characters of the provided list, and the values are the counts ofthese characters within the text. If a character in the list is not included inthe text, "0" should be written in the dictionary as the value of thischaracter. The function returns the created dictionary as a result. If the filedoes not exist, then the function returns an empty dictionary.""" write it into the code below.def text2dict(filename, characters):return # Remove this line to answer this question
- C++ CODİNG. I want you to write some functions using given struct and please create a class. When you write functions you need to use pointers, ccreate linked list. struct node { char data; node *right; node *down; } First function has to Display all the rows starting with a specific character Second function Display all the columns starting with a specific character Third one Delete all the rows starting with a specific character. And also You need to use header file. You do not need to write main function, as i said before ı just want to functions.Complete the below function that takes a file name and a list as arguments andreads the text within the corresponding file, then creates a dictionary whosekeys are the characters of the provided list, and the values are the counts ofthese characters within the text. If a character in the list is not included in the text, "0" should be written in the dictionary as the value of this character. The function returns the created dictionary as a result. If the file does not exist, then the function returns an empty dictionary. Here is an example case, assuming a file named "sample.txt" exists with the following content: ----- sample.txt -----This is an example sentence.This is yet another sentence.------------------------- >>> text2dict("sample.txt", ['a', 'b', 'c', 't']){'a':3, 'b':0, 'c':2, 't':4} """ def text2dict(filename, characters):return # Remove this line to answer this questionComplete the below function that takes a file name and a list as arguments andreads the text within the corresponding file, then creates a dictionary whosekeys are the characters of the provided list, and the values are the counts ofthese characters within the text. If a character in the list is not included in the text, "0" should be written in the dictionary as the value of this character. The function returns the created dictionary as a result. If the file does not exist, then the function returns an empty dictionary. Here is an example case, assuming a file named "sample.txt" exists with the following content: ----- sample.txt -----This is an example sentence.This is yet another sentence.------------------------- >>> text2dict("sample.txt", ['a', 'b', 'c', 't']){'a':3, 'b':0, 'c':2, 't':4} (DONT USE İNPUT .VERY İMPORTANT.)
- Write a function called list_to_dict(lst) that takes a 2-D list of sales records of this form.[["customer1", "bread", 5], ["customer2", "bread", 4.5], ["customer1", "egg", 6.75]]Your function will store the sales information in a dictionary, where each {key:value} pair of the dictionary stores {a unique customer: [ a list of all products purchased by this customer, total cost of these products]}, and returns the dictionary. Sample run,sales = [ ["customer1", "bread", 5], ["customer2", "bread", 4.5], ["customer1", "egg", 6.75],["customer2", "milk", 4.35], ["customer3", "egg", 3.6], ["customer4", "bread", 4.5],["customer1", "milk", 4.35], ["customer2", "egg", 3.6], ["customer4", "milk", 4.35] ]>>> record = list_to_dict(sales)>>> display(record)customer1 : [['bread', 'egg', 'milk'], 16.1]customer2 : [['bread', 'milk', 'egg'], 12.45]customer3 : [['egg'], 3.6]customer4 : [['bread', 'milk'], 8.85]The following are your requirements: make_dict(n) Write a function called make_dict(n), where n is an integer parameter. With a given number n, make a new dictionary in your function where the keys in the dictionary are in the range from 1 to n, and value for each key is the square of the key for that entry. Your function should return this dictionary, not print it. main() Call make_dict(n), where the user is asked to specify a number to pass into make_dict(n), and then prints the returned dictionary object.void dict_clear (dict_t* dict); This function clears the dictionary dict, destroying each pair key/value, but does not destroy dict itself (remember that dict was allocated using dict_create, so it will need to be freed at some point, but this is not this function’s job.) This is now the function that frees (destroys) a dictionary: void dict_destroy (dict_t* dict); This operates just as dict_clear, but in addition should free the memory that was allocated during dict_create. After a call to this function, if any other library function receives the pointer dict, the behavior is undefined (most likely, it will crash). This simple function returns the current size of the dictionary: size_t dict_size (const dict_t* dict);
- Write the following function in PYTHON a) display_PHU_summary() takes three input parameters, a 2D-list (similar to database), a dictionary (similar to dict), and an integer for the PHU_ID. Your function must print the following information, the id, name, city, website, and the total number of cases reported at this PHU. If the given PHU_ID is invalid, it should print a message and exit the function. >>> display_PHU_summary(database, dict, 2241) PHU id: 2241 PHU name: Kingston Frontenac and Lennox & Addington Public Health PHU city: Kingston, K7M 1V5 PHU website: www.kflaph.ca Total cases: 1 >>> display_PHU_summary(database, dict, 3895) PHU id: 3895 PHU name: Toronto Public Health PHU city: Toronto, M5B 1W2 PHU website: www.toronto.ca/community-people/health-wellness-care/ Total cases: 2 >>> display_PHU_summary(database, dict, 3800) The PHU Id is invalidDictionary-Returned Functiona) Define a function, dictSqrt() with a parameter, x: 1) Create a list, num and uses a loop to store, x numbers into the list in the range of (0, x). 2) Create a list, sqrtNum and store all sqrt of the numbers saved in the list above. 3) Use dict() and zip() to create a dictionary, sqrtDict, as the return value with numbers as the keys and their corresponding sqrt as the values.b) Define a main() function to do the following: 1) Get a random integer, n, in the range (1, 10).2) Call dictSqrt() with the argument and print the returned dictionary.c) Call main() function to initiate the tasks to be performed. Example OutputdictSqrt(3)will print the following:{0:0, 1:1, 2:1} PYTHON1. Course informationWrite a program that creates a dictionary containing course numbers and the room numbers ofthe rooms where the courses meet. The dictionary should have the following key-value pairs:Course Number (key) Room Number (value)CS101 3004CS102 4501CS103 6755NT110 1244CM241 1411The program should also create a dictionary containing course numbers and the names of theinstructors that teach each course. The dictionary should have the following key-value pairs:Course Number (key) Instructor (value)CS101 HaynesCS102 AlvaradoCS103 RichNT110 BurkeCM241 LeeThe program should also create a dictionary containing course numbers and the meeting timesof each course. The dictionary should have the following key-value pairs:Course Number (key) Meeting Time (value)CS101 8:00 a.m.CS102 9:00 a.m.CS103 10:00 a.m.NT110 11:00 a.m.CM241 1:00 p.m.The program should let the user enter a course number, then it should display the course’s roomnumber, instructor, and meeting time.