please code in python count_word: This function takes a filename and a keyword. Return the number of times the keyword occurs in the file. Initialize a variable to keep track of the number of times the keyword appears. Traverse the file by line. Use the count method on each line to find the number of times the keyword appears in it and add that amount to the variable
Q: Does this mean that software developers have a moral or ethical obligation to create code that can…
A: Software engineers design, create, and enhance the programs that support our contemporary way of…
Q: Start a discussion about how mobile devices, such as tablets and smartphones, may be used in the…
A: For many years, there has been debate concerning the use of mobile devices at work. While some…
Q: 9. In cell C14, create a formula using the COUNTA function to count the number of components in the…
A: MS Excel is a powerful spreadsheet software program developed by Microsoft for Windows, macOS,…
Q: Do databases need ethical considerations? Employee income and benefits data may not belong in the…
A: Databases ought to think about morality. Sensitive personal information is stored in databases to…
Q: Discuss briefly why it is inappropriate to use the Process (Non-Formal) method of software…
A: A set of steps are involved in the software development life cycle when developing and updating…
Q: What do you consider to be the key distinction between business intelligence and analytics?
A: Business intelligence and analytics are an umbrella that describes the applications, infrastructure,…
Q: How extensively can I utilize the IT simulation viewer?
A: Depending on your particular requirements and goals, you can leverage an IT simulation viewer to…
Q: These are some key distinctions between SLA and HDD
A: Data is stored in NAND-based flash memory by solid-state drives (SLAs), a type of storage device. It…
Q: 1)Create two Java classes, Desktop and Laptop that both are subclasses of Computer. a) A Desktop has…
A: Computer.java package acesssm1; public class TestComputer { public static void main(String[] args)…
Q: Is there going to be a significant need for the development of older systems down the road? At what…
A: There will be a significant need for the development of older systems in the future depends on the…
Q: Give concrete examples to distinguish between digital piracy and intellectual property infringement.
A: Digital piracy and intellectual property infringement are two terms that are commonly used…
Q: What is microprocessor explain in details
A: A microprocessor is an electrical component that functions as a computer's or other digital device's…
Q: Question 6 Not complete Marked out of 6.00 P Flag question a) What is the postfix notation for the…
A: Note: This is a multipart based question. As per company guidelines only first three parts are…
Q: The programmable connections in PLDs are implemented using a variety of process technologies;…
A: Below are six examples of process technologies that may use PLD programmable connections for your…
Q: How can we improve a program's capacity to adapt to new circumstances throughout its development?…
A: Improving a program's capacity to adapt to new circumstances throughout its development can be…
Q: In what ways may an organization lessen the possibility that its workers will violate the law?…
A: Organizations can take several proactive measures to reduce the likelihood of their workers…
Q: Name three technological processes that have been digitized in their entirety. Were there distinct…
A: Let's first discuss about what exactly is digitized technological processes then we will see three…
Q: Write a program to compute the exact value of the number of array accesses used by top-down…
A: To calculate the precise value of the number of array visits used by top-down and bottom-up…
Q: How susceptible is your computer to the many kinds of security holes that exist today? How can we…
A: In today's digital age, computers are vulnerable to various security vulnerabilities that can…
Q: Why would you need a router?
A: A router is a piece of networking gear that facilitates interaction between networks. This reply…
Q: Does this mean that software developers have a moral or ethical obligation to create code that can…
A: Software developers play a critical role in creating and maintaining code that is reliable,…
Q: Legacy system development options? When is system replacement cheaper than software update?
A: An outdated computer system, software program, or piece of equipment still used by a company or…
Q: As the CIA's "holy trinity" of secrecy, trust, and vigilance appears to be in action only seldom,…
A: The "holy trinity" of CIA's secrecy,The Central Intelligence Agency (CIA) leads the United States…
Q: Answer the given question with a proper explanation and step-by-step solution. This is the…
A: The program by including the necessary header files and defining the Date class The Date class has…
Q: When should data replication be used in a distributed database system to prevent data fragmentation?…
A: Data fragmentation is a common issue in distributed database systems, where data is spread across…
Q: A condition variable is an object able to the calling thread until notified to resume. block…
A: Condition variables are synchronization primitives that enable threads to wait until a particular…
Q: Describe a time when you found it difficult to communicate in an online course or programme. Do you…
A: In recent years, online learning has become increasingly popular due to its flexibility and…
Q: How different are the most common error signals from one another, and what do they typically mean?
A: The explanation and response to the question are given here.Respond Depending on the context in…
Q: Identify three insecure or at Kable protocols as most users depend on the network.
A: As more and more people rely on computer networks for communication and data exchange, the security…
Q: 3. (Score 30%) Implement pseudocode num TermSeries given in the solutions to homework #05 for…
A: Below is the Python code for implementing the numTermSeries pseudocode:
Q: What features should you look for in a new laptop the most?
A: When shopping for a new laptop, finding the one that meets your needs is crucial. The variety of…
Q: If there are three occurences of four different values within the data and nopvalue twice, how many…
A: Distribution is defined as the spreading of the product via the marketplace such that a large number…
Q: How should we address the many ethical concerns that have developed as a result of the broad…
A:
Q: A machine cycle consists of these four parts, and is also sometimes called a process loop. What…
A: Modern life includes machines. From production to transportation, we use machines. Input,…
Q: Identify three insecure or attackable protocols as most users depend on the network.
A: Identify three insecure or attackable protocols as most users depend on the network answer in below…
Q: write a custom Snort rule to handle Inbound and Outbound HTTP traffic on the Private (Host-Only)…
A: HTTP network traffic refers to the data transmitted over the HTTP protocol between a client (such as…
Q: So why does it matter so much that your bio is always fresh?
A: In this question we have to understand why doses it matter so much that bio is always fresh ? Let's…
Q: Should we promote the importance of cloud storage without minimizing the need for data backup for…
A: Cloud storage and data backup are both crucial components of modern business operations. Cloud…
Q: In what ways may an organization lessen the possibility that its workers will violate the law?…
A: Preventing workers from violating the law is essential for any organization to maintain a good…
Q: Why is it so difficult to avoid change in complex systems? What types of things happen over the…
A: Hello student Greetings Hope you are doing great. Thank you!!!
Q: Operating systems are used for providing virtual computers, enabling several activities at once, and…
A: It promotes the interchange of data between software and the physical components of the computer.…
Q: What is an optimizing compiler and how does it function? When would you want to use one as a…
A: An optimising compiler is a type of compiler that converts source code into optimised machine code…
Q: Two techniques for reducing rework expenses should be provided. Consider the need of progressive…
A: Certainly, here are two techniques for reducing rework expenses that incorporate progressive…
Q: Memory on Siobhan's computer is 8 gigabytes. The 8GB used by her programmes is in addition to the…
A: To understand how Siobhan's computer can utilize 8GB of memory for programs in addition to 2GB used…
Q: Answer the given question with a proper explanation and step-by-step solution. Below is your…
A: In the given code snippet, a function named "add" is defined that adds all items in the tuple and…
Q: Can data be estimated in the big picture? Can a student explore the world without becoming broke?
A: Data is a vital commodity today, and many industries and enterprises depend on it to fuel…
Q: What features should you look for in a new laptop the most?
A: Investing in a new laptop may be costly, so it's crucial to carefully consider which features and…
Q: ying to test the Firebase app on iOS, what kinds of challenges have you run in
A: Firebase is a popular mobile and web application development platform that provides a range of tools…
Q: Regarding computer networks, how important are humans?
A: In this question we have to understand Regarding computer networks, how important are humans ? Let's…
Q: Existed a significant distinction between compiled and interpreted languages?
A: We will understand the differences between compiled and interpreted languages, distinguishing…
please code in python
count_word: This function takes a filename and a keyword. Return the number of times the keyword
occurs in the file. Initialize a variable to keep track of the number of times the keyword appears.
Traverse the file by line. Use the count method on each line to find the number of times the keyword
appears in it and add that amount to the variable
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
- Finish this program from the code posted below! Note: There should be two files Main.py and Contact.py You will implement the edit_contact function. In the function, do the following: Ask the user to enter the name of the contact they want to edit. If the contact exists, in a loop, give them the following choices Remove one of the phone numbers from that Contact. Add a phone number to that Contact. Change that Contact's email address. Change that Contact's name (if they do this, you will have to remove the key/value pair from the dictionary and re-add it, since the key is the contact’s name. Use the dictionary's pop method for this!) Stop editing the Contact Once the user is finished making changes to the Contact, the function should return. Code:from Contact import Contactimport pickledef load_contacts():""" Unpickle the data on mydata.dat and save it to a dictionaryReturn an empty dictionary if the file doesn't exist """try:with open("mydata.dat", 'rb') as file:return…The function file_first_chars in python takes one parameter, fname, the name of a text file, and returns a string made up of the first character from each line in the file. You may assume there are no blank lines in the file. Hint: Use a for loop to iterate over the lines of the file and accumulate the string of first characters. NOTE: Return the function, don't print For example: Test Result print(file_first_chars("wordlist1.txt")) hsaemPHONE DIRECTORYDescription: Create a phonebook directory that will store the contact numbers of N persons. Your program should allow the user to add, view, delete, and update the contacts in the phonebook. Note that one person can have multiple contact numbers. The program will stop when the user command is ‘X’. Program command and entry should not be case-sensitive. That means commands ‘I’ or ‘i’ and the name “Jacky” or “JACKY” are the same. Each contact number can be 7 digits or 11 digits only. The user should input a string containing the command, name, and contact number(s) (Limit the contact number of each person to three). This string should be broken down into fields in order to separate the different values and store them in their appropriate variables. Use linked list in the implementation. Your node must declare at least four instance variables. Program flow: Command> I Jacky 09211234567 Remarks: New contact has been added. Command> V Jacky Contact…
- Python - Next Birthdate In this task, we will write a program that reads birthdate data from a given CSV file, and given the current date, determines which person's birthday will be celebrated next. Create a function with the following signature: nextBirthdate(filename, date) filename: parameter, which represents the CSV filename. date: parameter, which represents the current date. The function should open the CSV file, read the birthdate data, and determine which person's birthday will be celebrated next, given the current date. The name of the person should be returned. In other words, given a date, find the person whose birthday is next. Sample Run birthdates.csv Draven Brock, 01/21/1952 Easton Mclean, 09/02/1954 Destiny Pacheco, 10/10/1958 Ariella Wood, 12/20/1961 Keely Sanders, 08/03/1985 Bryan Sloan,04/06/1986 Shannon Brewer, 05/11/1986 Julianne Farrell,01/29/2000 Makhi Weeks, 03/20/2000 Lucian Fields, 08/02/2018 Function Call nextBirthdate("birthdates.csv", "01/01/2022") Output…Submission: Combine the code files for Q1 and Q2 as a zip file and submit in Moodle Question 1: Write a Program that to enter Student Name, Grade and print it to the screen with below requirements . . . . Asks the users how many student grades they want to enter. Based on that number the program should setup a loop to ask the user to enter student name and the student grade. Save this information using 2 arrays At the end the program must show the student names and grades with 1 student on each line on the screen Program should use Arrays and loops to achieve the task.Task: Loading data from files This exercise will require you to load some information from files and use it in your program. scene.txt contains a description of a series of shapes and colours to draw. You need to write code to read in the file data and draw the requested shapes in the correct colour. Each line in scene.txt will contain one of the following starting keywords followed by some data: COLOUR followed by 3 values: R, G, B CIRCLE followed by 3 values: X, Y, RADIUS RECT Followed by 4 values: X, Y, W, H LINE Followed by 4 values: X1, Y1, X2, Y2 CIRCLES are defined from the center. RECT's are defined from the top left. All values are space separated, and you can assume all input is correct (no errors). Please solve this program to draw the scene. I can't upload the file scene.txt, so I decide to screenshot a file for you. Subject: Java Programming
- BASH FLOW CHART: Create a flow chart to describe an algorithm that takes a text file with format ID,FirstName,Last Name,Street,City and appends a user ID field consisting of a C followed by theemployee ID. For example, the first entries in Lab 2's employees.txt are:0,Douglas L,Eberhard,Addenda Circle,Cornwall1,Elizabeth Sua,Hemauer,Wyatt Way,Peterborough2,Bailey Rae,Lopez,Turnagain Street,Sault Ste. MarieAfter processing, the entries should be:0,Douglas L,Eberhard,Addenda Circle,Cornwall,C01,Elizabeth Sua,Hemauer,Wyatt Way,Peterborough,C12,Bailey Rae,Lopez,Turnagain Street,Sault Ste. Marie,C2File names: color_square.py, chessboard.py, test_squares.py Positions on a chess board are identified by a letter and a number. The letter identifies the column; the number identifies the row. See the image below. You will provide the functions that allow us to determine: if a chessboard square is either black or white, given its coordinates. If the row/column is valid or not for the standard chessboard For example, if we pass in “d” for the column and 4 for the row, your function that determines color should return the string: “BLACK”. If we pass in "k" for the column to your function that validates columns, that function should return the boolean False. Requirements: Your function for validating the column should be able to accept upper or lowercase strings as parameters. Your functions for validating the row should be able to accept integers or strings as parameters. Your function that determines black-or-white may assume that the input has been validated prior to us calling…Average Number of WordsIf you have downloaded the source code from the Computer Science Portal you will find a filenamed text.txt in the Chapter 08 folder. The text that is in the file is stored as one sentenceper line. Write a program that reads the file’s contents and calculates the average number ofwords per sentence.(You can access the Computer Science Portal at www.pearsonhighered.com/gaddis.)
- PYTHON!!!! Write a program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line numbers range from 1 to the number of lines in the file. If the input is 0, the program quits. Otherwise, the program prints the line associated with that number. An example file and the program input and output is shown below: example.txt Line 1. Line 2. Line 3. Enter the input file name: example.txt The file has 3 lines. Enter a line number [0 to quit]: 2 2 : Line 2. The file has 3 lines. Enter a line number [0 to quit]: 4 ERROR: line number must be less than 3. The file has 3 lines. Enter a line number [0 to quit]: 0 The program works as expected for given input, test 1: Custom Test: Delete file at start Test Contents: import os.path try: os.remove('.test.txt')…PYTHON!!!! Write a program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename and input the lines of text into a list. The program then enters a loop in which it prints the number of lines in the file and prompts the user for a line number. Actual line numbers range from 1 to the number of lines in the file. If the input is 0, the program quits. Otherwise, the program prints the line associated with that number. An example file and the program input and output is shown below: example.txt Line 1. Line 2. Line 3. Enter the input file name: example.txt The file has 3 lines. Enter a line number [0 to quit]: 2 2 : Line 2. The file has 3 lines. Enter a line number [0 to quit]: 4 ERROR: line number must be less than 3. The file has 3 lines. Enter a line number [0 to quit]: 0 Make sure the program gracefully handles a user entering a line number that is too high. The program works as expected for given input, test 1 This…JAVA PPROGRAM Write a program that prompts the user to enter a file name, then opens the file in text mode and reads names. The file contains one name on each line. The program then compares each name with the name that is at the end of the file in a symmetrical position. For example if the file contains 10 names, the name #1 is compared with name #10, name #2 is compared with name #9, and so on. If you find matches you should print the name and the line numbers where the match was found. While entering the file name, the program should allow the user to type quit to exit the program. If the file with a given name does not exist, then display a message and allow the user to re-enter the file name. The file may contain up to 100 names. You can use an array or ArrayList object of your choosing, however you can only have one array or ArrayList. Input validation: a) If the file does not exist, then you should display a message "File 'somefile.txt' is not found." and allow the…