Question 8 - distinct_words In this problem you will produce a sorted list of the distinct words found in a file (all converted to lower-case). For example >>> distinct_words('peter.txt') ['a', 'if, 'is', 'of, 'peck', 'peppers', 'peter', 'picked', 'pickled', 'piper', 'the', 'where'] To receive full credit, \textbf{your code for this problem MUST reasonably use the word distribution function. (Hint: the keys of any dictionary are distinct)
Q: A new veterinary clinic will need to create a database. The clinic would want to preserve records of...
A: Intro For creating tables in 1NF or 1st Normal Form, the following properties must be satisfied: Th...
Q: Share TWO best IT applications that support your daily routine.
A: Your routine can either represent the moment of truth every day. Be that as it may, with innovation,...
Q: Describe the procedures involved in the programming analysis phase.
A: Introduction the question is about to Describe the procedures involved in the programming analysis p...
Q: Why is it that data recovery in a database environment is more difficult?
A: If a database are not well maintained or incorrect data with wrong logic are entered into the databa...
Q: A- Write a PYTHON script to find the value of Z from following relation: 50 mx2 Z = Where: Python x ...
A: Declare array variable x,y array variablesAssign p with 0, assign q with 0 and assign z with 0 Use f...
Q: Share TWO best IT applications that support your daily routine.
A: There are many IT applications that I use in day-in-day-out. Some of the them which are really good ...
Q: please upload some contemt for shop mangament system project for database design,like emtities,attri...
A: The main entities of the Shop Management System are Payments, Discounts, Products, Sales, Stock and ...
Q: 1. ABC Book Store is designing an online system for customers to buy books. A Customer can browse th...
A:
Q: e basic concept of opera
A: Sorry for that As per the bartleby guidelines we can solve only one question for you if you want to ...
Q: A body falls from rest in the gravitational field of the earth. The distance travelled in the fifth ...
A: Hi Dear!! Please give positive feedback!! As per the Bartleby guidelines I am giving a solution for ...
Q: Discuss the benefits and drawbacks of using the symbolic math toolbox over MATLAB alone to transform...
A: Introduction: The question is about to Discuss the benefits and drawbacks of using the symbolic math...
Q: Take the list of elements from the user and after that, you realised that you forgot an element to p...
A: I give the code in python along with output and code screenshot
Q: What exactly is a race condition? What exactly is synchronisation?
A: Answer: 1. Race condition: A race condition is a problem that occurs when a system attempts to perf...
Q: What exactly is a bounded buffer?
A: The bounded-buffer problem (aka the producer-consumer problem) is a classic example of concurrent ac...
Q: What exactly does the term "boilerplate" imply?
A: Introduction: Boilerplate is a word that refers to standardized language, copy, papers, processes, o...
Q: Matlab code for the periodic signal. Show running code and output
A: Explanation: Code works fine, I have provided screenshot and output for no error. See below step for...
Q: B) Write a PYTHON script to enter a value of S (between 1 and 3) for (50) entered values of X then f...
A: Python program to solve the given problem is below.
Q: e type declaration? type1 :: a -> b -> c type2 :: (a -> b -> c) -> (a,b) -> c type3 :: (a -> b) -...
A: From a Programming language Haskell, what could be a answer for these type declaration? type1 :: a -...
Q: Describe HADOOP's two primary levels as well as two more supporting modules.
A: Introduction: Hadoop is a free and open-source software framework for storing data and executing app...
Q: Explain how string functions are used to handle C-strings.
A: Introduction: the question is about how string functions are used to handle C-strings. and here is t...
Q: Find the critical z-value(s) for a hypothesis test given: a = 0.05 two-tailed test
A: Answer is below:
Q: Using binary state encodings, complete a state transition table and output table for the FSM. Write ...
A: Given equation about state machine.
Q: F1(ABC) = A'+A(A+B')(B+C') (a) Using Boolean manipulation, convert F1 into sum of product (SOP) into...
A: I have Provided this answer with full description in step-2.
Q: What Are the Eight Best Computer Architecture Concepts?
A: Find them listed below.
Q: What IOS command v
A: PFB the command:
Q: In the.Net programming language, what is the difference between a function and a stored procedure?
A: Introduction: The function must return a value. However, this is optional with Stored Procedures. Ev...
Q: Explain why log records for undo-list transactions must be handled in reverse order, but redo is exe...
A: Log records Any transaction needs to create a log record before modifying the database. These log r...
Q: The following sequence of bits 0100110111 is to be transmitted using QPSK modulation. Take these dat...
A:
Q: Briefly explain LOS and its 6 categories.
A: explain LOS Ans:- LOS stand for level for services .The notion of a traffic facility's Level-of-Ser...
Q: What is the rationale behind Angular's use of the AOT compiler?
A: Components and their HTML templates make up the majority of an Angular application. Angular apps req...
Q: In light of Don Norman's idea of 'user problems,' we'll talk about how to utilize formative assessme...
A: Introduction: "Providing physical, logical, semantic, and cultural restrictions directs actions and ...
Q: CD OD ol 1\ 00
A: Output: Y= CDA'+B'
Q: Consider a system with 20 requests and out of 20 , 4 requests are already in cache memory. What will...
A: Introduction Consider a system with 20 requests and out of 20 , 4 requests are already in cache mem...
Q: f:A B A = {0, 1, 2}, B = {0,1} f(0) = 1, f(1) = 0, f(2) = 1 1.Is f, as described above, a function? ...
A: Yes f is a function. This is because each element of its domain A is assigned to exactly one element...
Q: e demo
A: The use of security policies and procedures to reduce the overall risk or impact of cybersecurity th...
Q: Given a zero-terminated sequence of non-zero integers in order from smallest to largest, output the ...
A: Explanation: #first create a list in python. List = [-10 ,-4,-2,1,5,6,8,9,0] #Then create a variable...
Q: How may modifications to permission, authentication, and roles aid in mitigating and dealing with th...
A: Enterprise System: In this, you must create two pages of chart, and in that chart, you must ensure t...
Q: Sort DNS records by the kind of record they include. Describe each with examples and a brief explana...
A: Introduction: A DNS record is a database entry that maps a web address to an IP address. DNS records...
Q: As data is read from the file, the read position moves forward, closer to the end.
A: Introduction: The read position progresses towards the end of the file, as items are read from it, w...
Q: c) Give two separate examples when a process changes its state to waiting and ready from the running...
A: We are asked a beautiful question on process state diagram in operating system where we will underst...
Q: When do you believe it is best to keep all data and applications in-house, and when do you believe i...
A: Introduction: Yes, your knowledge is comparatively safe within the cloud—likely far more thus than o...
Q: What is the connection between data and information?
A: Data: It is an assortment of values. Those values can be characters, numbers, or some other type. ...
Q: 3. Given the following minterm expansion: F(a, b, c, d) = Em(0, 2, 3, 4, 8, 10, 11, 15) Draw the K-M...
A:
Q: In JDBC, what is the difference between CLOB and BLOB data types?
A: The full form of CLOB is Character Large Object. The full form of BLOB is Binary Large Object.
Q: B) Write a PYTHON script to enter a value of S (between 1 and 3) for (50) entered values of X then f...
A: In this code we have taken a list , the user enters 50 random numbers Then 3 conditions are provided...
Q: 1.Shów thất 200 € O(1) and 200 2. Show that 2n+5 € O(n²) 3. Show that 3 log n + log (log n) 0(log n)...
A: Time complexity: Estimation of cpu computation required to terminate algorithm.
Q: 5.11 LAB - Insert rows into Horse table The Horse table has the following columns: • ID - integer, a...
A: insert into Horse values('Babe','Quarter Horse',15.3,'02-10-2015');insert into Horse values('Indepen...
Q: def validate_priority(priority): ''' validate the "priority" parameter Returns True if "...
A: 1. In your Program you did call the function and also did not print the result. 2. while checking if...
Q: Why do you think Information Technology as a course is relevant in your course of study?
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other questions ...
Q: In this assignment, you are required to test the well-known sorting algorithms (quicksort) performan...
A: Sorting Algorithm Sorting Algorithm are a hard and fast of commands that take an array Or list as an...
this is in pythojn
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Median Function – In statistics, the median of a set of values is the value that lies in the middle when the values are arranged in sorted order. If the set has an even number of values, the median is the average of the two middle values. Your program should start with two arrays of integers containing the following values: Even numbered array: 17 32 45 68 99 101 67 89 22 27 Odd numbered array: 17 32 45 68 99 101 67 89 22 Using a sort function of your choice, first sort the arrays. NOTE: you may use the Standard Template Library sort function or your own sort function. Then, write a function that determines the median of a sorted array. The function should take an array of numbers and an integer indicating the size of the array and return the median of the values in the array. The same function should be called twice – once for the even array and once for the odd array. Your program should also have a printArray function that can be used to print the sorted array. (It…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 phytonWord IndexWrite a python program that reads the contents of a text file. The program should create a dictionary inwhich the key-value pairs are described as follows:Key. The keys are the individual words found in the file.576Values. Each value is a list that contains the line numbers in the file where the word (thekey) is found.For example, suppose the word “robot” is found in lines 7, 18, 94, and 138. The dictionarywould contain an element in which the key was the string “robot”, and the value was a listcontaining the numbers 7, 18, 94, and 138.Once the dictionary is built, the program should create another text file, known as a word index,listing the contents of the dictionary. The word index file should contain an alphabetical listingof the words that are stored as keys in the dictionary, along with the line numbers where thewords appear in the original file. Figure 9-1 shows an example of an original text file(Kennedy.txt) and its index file (index.txt
- Dec2Hex function : def decimal_to_hex(number): hex_map = {0: '0', 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6', 7: '7', 8: '8', 9: '9', 10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F'} hex_digits = [] while number > 0: hex_digits.append(hex_map[number % 16]) number //= 16 # Reverse the order of the hex digits and join them to form the final hex string hex_string = ''.join(reversed(hex_digits)) return f'0x{hex_string}' if hex_string else '0x0' Perform a Profile of your Dec2Hex function. Write a function that takes a timedate object as a parameter andcalculates the number of years from NOW to the time in the timedateobject. Add unit-testing code to your Dec2Hex exercise, and then perform aUnit test of the updated Dec2Hex code.Contact list: Binary Search A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Define and call the following function. The return value of FindContact is the index of the contact with the provided contact name. If the name is not found, the function should return -1 This function should use binary search. Modify the algorithm to output the count of how many comparisons using == with the contactName were performed during the search, before it returns the index (or -1). int FindContact(ContactInfo contacts[], int size, string contactName) Ex: If the input is: 3 Frank 867-5309 Joe 123-5432 Linda…Word FrequencyWrite a python program that reads the contents of a text file. The program should create a dictio-nary inwhich the keys are the individual words found in the file and the values are the number of timeseach word appears. For example, if the word “the” appears 128 times, the dictionary wouldcontain an element with 'the' as the key and 128 as the value. The program should eitherdisplay the frequency of each word or create a second file containing a list of each word and itsfrequency.
- phyton Topics: list and list processing You will write a program to read grade data from a text file, displays the grades as a 5-column table, and then print the statistics (min, max, median, and median). You can assume that the input file only one number per line. You can assume the user always enter a file that exists. The median is the value in the middle of a sorted list. To sort a list, use list.sort() function. It’s computed as below. For a list of odd length, the middle number is just the length divide by 2. For the list, [1,2,3], the median is 2 since 2 is in the middle of the list. The middle index is 3//2, which is 1. Remember that // is the integer division operator. When the length of the list is even, there are two middle numbers. The median is the average of the two middle numbers. For example, [1,2,3,4], the median is (2+3)/2 = 2.5. The two middle indexes for this example are (4//2)-1 = 1 and (4//2) = 2. Functions you need to write: read_grades() Prompts…Arithmetic progression def arithmetic_progression(items): An arithmetic progression is a numerical sequence so that the stride between each two consecutive elements is constant throughout the sequence. For example, [4, 8, 12, 16, 20] is an arithmetic progression of length 5, starting from the value 4 with a stride of 4. Given a non-empty list items of positive integers in strictly ascending order, find and return the longest arithmetic progression whose all values exist somewhere in that sequence. Return the answer as a tuple (start, stride, n) of the values that define the progression. To ensure unique results to facilitate automated testing, if there exist several progressions of the same length, this function should return the one with the lowest start. If several progressions of equal length emanate from the lowest start, return the progression with the smallest stride. items expected results [42] (42, 0, 1) [2, 4, 6, 7, 8, 12, 17] (2, 2, 4) [1, 2, 36, 49, 50, 70, 75, 98,…3. lookup_friends_heights This function takes a friends database (a list of dictionaries, like the previous functions) and a list of friends names, and it returns a list of heights for the specified friends. If a given friend's name is not present in the friends database, we put a None in the corresponding slot. We assume that there will be at most one friend with a given name in the list. You may want to use nested for-loops for this function. Sample calls should look like this. >>> lookup_friends_heights([{"name":"todd","height":170},{"name": "sarah", "height":165},{"name":"dweezil", "height":175}], ["dweezil", "sarah"]) [175, 165] >>> lookup_friends_heights([{"name": "todd","height":170},{"name": "sarah","height":165},{"name": "dweezil", "height":175}], %3D ["sarah", "elíza", "dweezil"]) [165, None, 175]
- 3. lookup_friends_heights This function takes a friends database (a list of dictionaries, like the previous functions) and a list of friends names, and it returns a list of heights for the specified friends. If a given friend's name is not present in the friends database, we put a None in the corresponding slot. We assume that there will be at most one friend with a given name in the list. You may want to use nested for-loops for this function. Sample calls should look like this. >>> lookup_friends_heights([{"name":"todd","height":170},{"name": "sarah","height":165},{"name":"dweezil","height":175}], ["dweezil", "sarah"]) [175, 165] >>> lookup_friends_heights([{"name": "todd","height":170},{"name": "sarah","height":165},{"name": "dweezil", "height":175}], ["sarah", "elíza", "dweezil"]) [165, None, 175]3. lookup_friends_heights This function takes a friends database (a list of dictionaries, like the previous functions) and a list of friends names, and it returns a list of heights for the specified friends. If a given friend's name is not present in the friends database, we put a None in the corresponding slot. We assume that there will be at most one friend with a given name in the list. You may want to use nested for-loops for this function. Sample calls should look like this. >>» lookup_friends_heights([{"name":"todd", "height":170},{"name":"sarah","height":165}, {"name":"dweezil","height":175}], ["dweezil", "sarah"]) [175, 165] >>> lookup_friends_heightsC[{"name":"todd","height":170},{"name":"sarah","height":165}, {"name":"dweezil","height":175}], ["sarah", "eliza", "dweezil"]) [165, None, 175] 4. class definition for Friend For the next version of the friends database (coming soon!), we want to use classes rather than dictionaries. Define a Friend class , where each Friend object…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 value2- display letter and mean of values in corresponding list3- display the letter that the highest value among all lists Example output:highest value in each letters lista : 4b : 8c : 9 Mean value for each letter:a : 2.5b : 6c : 5 The highest valuec : 9