dict = { 'a': [1,2,3,4] 'b': [3,6,7,8] 'c': [9,1,9,1] { Iterate over the above dictionary 1- display letter and highest value 2- display letter and mean of values in corresponding list 3- display the letter that the highest value among all lists Example output: highest value in each letters list a : 4 b : 8 c : 9 Mean value for each letter: a : 2.5 b : 6 c : 5 The highest value c : 9
Q: Words or names defined by the programmer are called __________.
A: Lets see the solution.
Q: Hardware and software are two different things. What is the difference between the two?
A: Difference between hardware and software is mentioned below,
Q: write in virtual machine code: 1. Execute the file with an input that can hack the program 2. Chan...
A: When a program has defects, code injection may be used to inject (or transmit) unexpected data into ...
Q: Given the following function: f(a, b, c, d, e) = abcē + bad + čēbd + ade + āce Use Shannon's expansi...
A:
Q: You have an ordered list N consisting of the last names of your friends, and you have created an AVL...
A: SUMMARY: - Hence we discussed all the points.
Q: The personal computer was invented by which corporation in 1977?
A: Preassembled personal computers, such as the Apple II, the Tandy Radio Shack TRS-80, and the Commodo...
Q: 2. Perform addition of two hexadecimal numbers, 3h and 4h, by taking these as inputs from the user. ...
A: Assembly language: Assembly language is a low level programming language. It is used to tell directl...
Q: According to Holt, the strongest overall predictor of virtual offending behavior was what? According...
A: The domain of cyber security is of utmost importance as it leads to a safe and positive environment ...
Q: The history of the computer is summarised here.
A: INTRODUCTION: A Brief Overview of Computer History The origins of computers may be traced back to Ba...
Q: Write a Python program to list all the files which is present under "/" directory.
A: I have provided DIRECTORY SCREENSHOT , PYTHON CODE and CODE SCREENSHOT WITH OUTPUT ---...
Q: Instructions: In the code editor, you are provided with a main() function that asks the user for a c...
A: Here is the approach Iterate over the character array using the for loop from the start of the arr...
Q: What are the two most important components on a computer's motherboard?
A: I have answered this question in step 2.
Q: . Discuss the structure of a typical operating system using a specified design methodology
A: A kernel, possibly some servers, and possibly some user-level libraries make up an os. The kernel de...
Q: Encode the following ARM assembly instruction to ARM machine language code. CMNLT r0,#0×FF Ox
A: ARM assembly to ARM machine language code
Q: When it comes to the system and the user area, what exactly is the distinction?
A: Introduction: MODEM: A modem is a device that modulates and demodulates electrical signals and estab...
Q: 1. Discuss the concept of services provisioning in the context of modern operating systems and moder...
A: The solution for the above-given question is given below:
Q: Write a console application that uses at least five (5) different methods of Math class. Provide a m...
A: Program Code: using System; public class GFG { // Main method static public void Main() { //usi...
Q: Write a method using haversine formula : haversinecalculator(float lat1, float lon1, float lat2, fl...
A: The Haversine formula calculates the shortest distance between two points on a sphere using their la...
Q: What are the three common types of cloud computing services?
A: Lets see the solution.
Q: at is the boolean expression for output f of
A: Lets see the solution.
Q: ve an example of activities of the last network construction. (A must finish before B can start, and...
A: Lets see the solution.
Q: Why is John von Neumann so significant?
A: Introduction: Von Neumann was a Hungarian mathematician who became famous in the early twentieth cen...
Q: Perform Selection sorting algorithm using the given array elements: 20, 12, 10, 15,...
A: In Selection sorting algorithm, the sorting is done on the basis that the smallest number/element (i...
Q: Why were computer programming languages invented?
A: Introduction: Why were computer programming languages invented? Understanding technology may be aide...
Q: 14) Suppose FSA M1 and M2 are defined as follows: M1(Q, S, qo, A, 8) = ({I, II, III }, {a, b}, I, {I...
A: According to the information given:- we have to follow the instruction and perform the task.
Q: When it comes to a processor's access to main memory, weigh the benefits of a loosely connected syst...
A: The major difference between a loosely linked and a symmetric multiprocessing system is that the for...
Q: In what way did the computer get made?
A: Introduction: Computers store and process data using a binary system of ones and zeros. Computers a...
Q: Answer TRUE if the expression will return non-zero and FALSE if not. Evaluate using the following d...
A: Answer TRUE if the expression will return non-zero and FALSE if not. Evaluate using the following de...
Q: What are the major challenges in managing information systems? Explain the connection between the Fi...
A: What are the major challenges in managing information systems? Explain the connection between the Fi...
Q: The three primary activities of a program are __________, __________, and __________.
A: Introduction: System software refers to the programmes that control and manage the basic functions o...
Q: Name two other major purposes of operating systems in addition to virtualization, concurrency, and p...
A: Here is the solution:-
Q: The history of evolution and computer systems in terms of technology and trends should be given in a...
A: Introduction: In combination with technological improvement, the history of technology has seen the ...
Q: You have been asked to prepare a report that evaluates possible client/server solutions to handle a ...
A: Lets see the solution in the next steps
Q: Čomplete the below function in Python language def checkPassword(pass): #pass must have length betwe...
A: Python Code: # Function to validate the passworddef checkPassword(password): val = True if len(pas...
Q: تبديل قاعة C5 & B5 بقاعة 105 طلبة الصباحي, محاضراتكم في قاعة C5 و B5 ت تحول الى قاعة 105 خلال الاسبو...
A: The question mentioned the following things: It is a notice given to Student by school/University. T...
Q: What changes would you need to make to ensure that the application works on mobile phone browsers?
A: Lets see the solution.
Q: Can instances of a relation (sample data)prove the existence of a functional dependency? Why or why ...
A: Lets see the solution.
Q: awk is similar to the SQL language in that you can query certain records. What command below will se...
A: Solution: The AWK works to scan the each line of text or the records in the file and carry out any i...
Q: Give any two characteristics of excellent computer-aided design gear that are not related to compute...
A: Computer-aided design (CAD) software is used in the manufacturing industry to help engineers design ...
Q: Grace Hopper, did you create the computer?
A: When it came to computer programming, Grace Hopper was a pioneering pioneer. The first compiler was ...
Q: Describe the disadvantages of three-tier architectures.
A: Lets see the solution.
Q: 1. For each part below, use the following plaintext message and show your work. Success a. What is t...
A: raditional Symmetric Key Ciphers . a. What is the corresponding ciphertext if an auto-key cipher wit...
Q: I. O(n) II. O(log n) III. O(n^2) IV. O(n log n) V. None of the above
A: Given What is the time complexity of the following algorithm power(n,x).? Assume that each operation...
Q: If, A = {3, 5, 7, 9} B = {2, 4, 6, 8, 10} C = {12, 14, 18, 20, 24} D = {21, 26, 31, 36} A. Stat...
A: Given sets are: A = {3, 5, 7, 9} B = {2, 4, 6, 8, 10} C = {12, 14, 18, 20, 24} D = {21, 26, 31, 36} ...
Q: Solve by using recursive solutions! no looping statements thank you computePI(int n) – One remarkab...
A: RECURSION : Recursion is the method where the function keeps calling itself until the base case or t...
Q: XC. In the child process we do a PPID. What is the value returned for getppid() (for XA) at 9:10am? ...
A: Zombie process: If a parent forks a child and gets busy and in the meanwhile the child terminat...
Q: According to the Moore's law, how does Moores law enable supercomputing and grid computing?
A: Solution : Moore's law : As per standard meaning, Moore's law states that the number ...
Q: A variable must be __________ before it can be used in a program.
A: Lets see the solution in the next steps
Q: java Singly linked list need help with numbers 5 only 1 to 5 is done but they connected 5 is in the...
A: Algorithm: Step 1: Create the class Citizen Step 2: Define required variables Step 3: Write struct N...
Q: A situation
A: Given A situation where team members use multiple spreadsheets on their desktops to record, stor...
dict = {
'a': [1,2,3,4]
'b': [3,6,7,8]
'c': [9,1,9,1]
{
Iterate over the above dictionary
1- display letter and highest value
2- display letter and mean of values in corresponding list
3- display the letter that the highest value among all lists
Example output:
highest value in each letters list
a : 4
b : 8
c : 9
Mean value for each letter:
a : 2.5
b : 6
c : 5
The highest value
c : 9
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- reverse_number_in_list(number_list:list)-> list This function will be given a list of numbers your job is to reverse all the numbers in the list and return a list with the reversed numbers. If a number ends with 0 you need to remove all the trailing zeros before reversing the number. An example of reversing numbers with trailing zeros: 10 -> 1, 590 -> 95. None of the numbers in the number_list will be less than 1. Example: number_list = [13, 45, 690, 57] output = [31, 54, 96, 75]Data structures concatenate_dict(dict_list:list)->dict This function will be given a single parameter known as the Dictionary List. Your job is to combine all the dictionaries found in the dictionary list into a single dictionary and return it. There are two rules for adding values to the dictionary: 1. You must add key-value pairs to the dictionary in the same order they are found in the Dictionary List. 2. If the key already exists, it cannot be overwritten. In other words, if two or more dictionaries have the same key, the key to be added cannot be overwritten by the subsequent dictionaries. Example: Dictionary List: [{'Z': 6, 'k': 10, 'w': 3, 'I': 8, 'Y': 5}, {'Y': 1, 'Z': 4}, {'X': 2, 'L': 5}] Expected: {'Z': 6, 'k': 10, 'w': 3, 'I': 8, 'Y': 5, 'X': 2, 'L': 5} Dictionary List: [{'z': 0}, {'z': 7}] Expected: {'z': 0} Dictionary List: [{'b': 7}, {'b': 10, 'A': 8, 'Z': 2, 'V': 1}] Expected: {'b': 7, 'A': 8, 'Z': 2, 'V': 1}python exercise: Write a Python function called get_top_students that takes the list of dictionaries as input and returns a dictionary containing the name and GPA of the top two students in the list. Each dictionary has the following keys: "name", "age", "major", and "gpa".
- Find Country Function Name: findCountry() Parameters: capitalList ( list ) Returns: Dictionary mapping each capital to its country( dict ) Description: Given a list of countries' capital cities, write a function that returns a dictionary that maps a capital to its country's name. Note: Assume that all capital cities provided are valid. example test cases: >>> findCountry(('tokyo', 'delhi', 'stockholm']) {'tokyo': 'Japan', 'delhi": 'India', 'stockholm': 'Sweden'} >>> findCountry(l'paris', 'canberra', 'copenhagen']) {'paris': 'France', 'canberra': 'Australia', 'copenhagen': 'Denmark'} For this assignment, use the REST countries API (https://restcountries.com/#api-endpoints-v2). For all of your requests, make sure you to use version 2 of the REST countries API (V2), not version 3 (V3.1). If you make a request with the URL: https://restcountries.com/v2/alpha/usa, you will receive the following response: { "name": "United States of America", "topLevelDomain": [".us"], "alpha2Code": "US",…11111 2) Name: 2. The following procedure is intended to return the number of times the value val appears in the list myList. The procedure does not work as intended. Line 01: PROCEDURE countNumOccurences (myList, val) Line 02: { Line 03: FOR EACH item IN myList Line 04: } BL Line 05: count 0 Line 06: IF(item = val) %3D Line 07: Line 08: count count + 1 :60 Line 10: { { RETURN(count) Line 11: Line 12: } Which of the following changes can be made so that the procedure will work as intended? a. Moving the statement in line 5 so that it appears between lines 2 and 3 C. Changing line 6 to IF(item = count) b. Changing line 6 to IF(myList[item] = val) d. Moving the statement in line 11 so that it appears between lines 9 and 10Data structures dict_from_string(dict_str:str)->dict This function will be given a single parameter, a string representing a dictionary. Your job is to convert the string into an actual dictionary and return the dictionary. Make sure all key-value pairs in the string exist in the newly created dictionary. The string will contain only numbers or single letters as key values pairs. Make sure all letters are kept as strings and all numbers are converted to integers in the newly created dictionary. Example: String Input: '{9: 'V', 'G': 0, 'M': 9, 'u': 3, 2: 'o', 8: 'u', 'q': 9, 'D': 1}' Expected: {9: 'V', 'G': 0, 'M': 9, 'u': 3, 2: 'o', 8: 'u', 'q': 9, 'D': 1} String Input: '{10: 'D', 1: 'Z', 5: 'a'}' Expected: {10: 'D', 1: 'Z', 5: 'a'} String Input: '{'M': 2, 'V': 0, 3: 'x', 6: 'J', 5: 'J', 7: 'T', 8: 'P', 4: 'q', 1: 'h'}' Expected: {'M': 2, 'V': 0, 3: 'x', 6: 'J', 5: 'J', 7: 'T', 8: 'P', 4: 'q', 1: 'h'} String Input: '{3: 'D', 10: 'T', 7: 'm', 'u': 9, 't': 5, 6: 'Z', 'H': 10, 'B':…
- Capital QuizWrite a program that creates a dictionary containing the U.S. states as keys, and their capitals as values. (Use the Internet to get a list of the states and their capitals.) The programshould then randomly quiz the user by displaying the name of a state and asking the userto enter that state’s capital. The program should keep a count of the number of correct andincorrect responses. (As an alternative to the U.S. states, the program can use the names ofcountries and their capitals.) in phytonTrue/False 7. Items can be removed from a list with the del operatorData structures return_growing_num_list(max:int) -> list This function will be given a single number, it should return a list of strings of numbers. Each string in the list will only contain a single number repeated an arbitrary amount of times. The number each string will contain will be equal to the current string's index+1. The number in the string should be repeated the same number of times as the string's index+1. Each number in the string should be separated by a space. This list should stop when its size equals the max number specified. Example: max = 3 output = ['1', '2 2', '3 3 3'] max = 4 output = ['1', '2 2', '3 3 3', '4 4 4 4']
- Program Three: Lists and Dictionaries Pizza3.py You need to copy Pizza2.py and make the following changes: 2. 1. Ask how many pizzas are being purchased. Use a loop to ask for the size and options of each pizza. These will be put into a list or a dictionary. 3. Your Outputs() should read from the list or dictionary and format the output as shown below. ↓ Pizza3 Welcome to Andy's Pizza3 Menu Program How many pizzas would you like to order? 2 You can choose the pizza size followed by a list of optional toppings #1 What size pizza would you like to order? S/M/L are the options:m What toppings would you like to add to customize your pizza? Enter a Y or N (Yes or No) to the following options: Would you like cheese? Y/Ny Choose from the following cheese options: Please c Would you like protein? Y/Ny Choose from the following protein options: Please enter C/c for Chicken, T/t for Tofu, S/s for Shrimp:c enter C/c for Cheddar, P/p for Pepper Jack, S/s for Swiss:p Would you like olives? Y/Ny…Program One: Basics Pizza1.py You do NOT need to use functions or a restart feature. You DO need comments! • This program calculates the total cost of buying a Pizza, and creates an invoice with prices for all the ingredients and the final total. • Your program should ask the user to input the size of the pizza and all the add-ons the user wants. • Include validation and basic exception handling. Accept the appropriate letter response in upper or lower case. • The program must calculate the total price of the pizza based on the size and the add-ons. You will have all the add-on prices in your code since the user does not get to choose what to pay. • Display the output as shown, controlling for the number of decimal places, $ sign and alignment. • Run more than once to test all the pizza options. I will be testing your program! Pizza2.py You need to copy Pizza1.py and make the following changes: 1. Using the MIPO model, rewrite your program so that a Main() function controls the program…A ____ supports manipulation of items at any point within a linear collection. Question 5 options: dictionary list stack queue