python exercise: Write a Python function called calculate_average that takes a list of numbers as input and returns the average of the numbers in the list. If the input list is empty, the function should raise an EmptyListError exception. Handle the case where the input list is empty by raising a custom EmptyListError exception. This exception should have an error message that says "Cannot calculate average of an empty list".
Q: What method does SETI use to connect individual computers into a potent system?
A: SETI uses distributed computing to connect individual computers into a potent system.
Q: When individuals refer to an operating system, what exactly do they mean by that? The following are…
A: When individuals refer to an operating system, what exactly do they mean by that? The following are…
Q: The next sections will provide you with the definitions of the classes MonthCalender and…
A: Overture to Month Calendar plus DateTimePicker: MonthCalendar and DateTimePicker are two of the…
Q: Many different things can contribute to the onset of a downgrade attack.
A: A downgrade attack is a type of cyber attack where an attacker manipulates the communication between…
Q: Have you previously utilised top-down design principles? Please explain why if so. Include at least…
A: A top-down design is when a system is broken down into smaller pieces to better understand its…
Q: What are three options that could be utilised in a project based on the structure of the decision…
A: In step 2, I have provided Answer-------------
Q: Exp
A: The architecture of an application plays a critical role in determining its performance,…
Q: Q2. List the typical tasks during the software maintenance phase with an example. List the different…
A: Here is your solution :
Q: Give a high-level summary of the nonvolatile solid-state memory technologies that are gaining…
A: Technologies used in nonvolatile solid-state memory allow computers to preserve data even after the…
Q: Describe how the protection and instruction of set architecture is carried out.
A: 1) Set architecture, or instruction set architecture (ISA), refers to the set of instructions that a…
Q: What components are necessary to construct a web-based application?
A: A web-based application, also known as a web application, is a software program that can be accessed…
Q: What do we think of when we hear the phrase "operating system," and more specifically who or what do…
A: The operating system is basically the heart of the system, which operates the hardware and the…
Q: There are several advantages to using dynamic memory rather than static memory, but there are also…
A: Flexibility: Dynamic memory allocation allows for reminiscence to be owed and deallocated…
Q: What does "avalanche effect" mean exactly? Modern block cyphers do not support avalanche cyphers.…
A: The avalanche effect is a desirable property of cryptographic algorithms, especially block ciphers.…
Q: Does implementing technology advancements in education, business, and society outweigh the potential…
A: Working with computers and other technologies is easier if you understand them. in the following…
Q: If you want to join the computer to an existing domain after installing Windows 7, which network…
A: Selecting Network Location for Windows 7 Domain Join: When you want to join a computer to an…
Q: Write in C: Quesiton 2. Implementing non-blocking / non-echoing mode for xv6 console The default…
A: To implement non-blocking and non-echoing mode for the xv6 console, we can modify the console driver…
Q: Describe the development of the internet as well as the technologies that lie underneath its…
A: The swelling of the Internet can be traced rear to the late 1960s, with its beginning in a US…
Q: Teaching is a multi-dimensional profession that encompasses a wide range of subject matter areas.
A: Given that, Teaching is a multi-dimensional profession that encompasses a wide range of subject…
Q: In addition to giving a definition of the term, can you provide some specific instances of how…
A: What is vulnerability: Vulnerability refers to weaknesses or gaps in a system's security that could…
Q: Windows recognises four fundamental disc volume categories. Using only your own words (no copying is…
A: Windows operating system recognises four fundamental disc volume categories, each with unique…
Q: Please provide a brief description of the nonvolatile solid-state memory techniques that are…
A: In this question we need to explain the nonvolatile solid-state memory techniques which are becoming…
Q: Route first. Differentiate two prominent routing strategies.
A: Given, Differentiate two prominent routing strategies.
Q: What is the appropriate number for the server port? Choose the correct answer a any number between 0…
A: Below is the complete solution with explanation in detail for the given question about the…
Q: The following SQL for a Point of Sale database for a grocery store is not properly constructed. As…
A: The SQL are modifed and given below with explanation
Q: Should we make use of an asynchronous bus or a synchronous bus in order to link the CPU and the…
A: What is CPU: The CPU (Central Processing Unit) is the brain of a computer system and is responsible…
Q: Chain Link Consulting is an IT consulting firm that specializes in system security issues. The…
A: Chain link consulting is an IT consulting firm specializing in system security issues. As experts in…
Q: Some IT security specialists believe that former computer criminals should be employed to identify…
A: Security vulnerabilities: Security vulnerabilities refer to weaknesses or flaws in a system's…
Q: 1. Use the starter code to create your PromptBank and modify it to work with your project. (Note:…
A: See the code below in java
Q: Do you understand why it's essential to use authentication? What are the benefits and downsides of…
A: Authentication is making sure a person or process is who they say they are by using IDs like…
Q: Introduce real-time operating systems before going into specific examples. Compare it to a typical…
A: An operating system created to specifically address the needs of real-time applications is known as…
Q: What do you consider to be the four most significant characteristics in a software engineer? Which…
A: Below are characteristics that are generally considered important for software engineers: 1) Strong…
Q: Analyse the differences between the Von Neumann architecture and the Little Man computer. Which…
A: The Von Neumann architecture is a computer architecture model that was first proposed by John von…
Q: Is it a good idea to have software service providers take care of all of your technology needs?…
A: Cost-effectiveness: By eliminate the need for business to invest in the communications, technology,…
Q: Explain the distinction between logical address and linear address, as well as the relationship…
A: Logical Address: A logical address, also known as a virtual address, is a memory address generated…
Q: Why is it important to do a vulnerability analysis?
A: Vulnerability analysis is a crucial aspect of maintaining the security and integrity of any system,…
Q: Computer studies How can disruptive technologies allow organisations to make major changes?
A: Disruptive technologies can allow organizations to make major changes by introducing new and…
Q: If you were to hire a software engineer, what would you consider to be the four most significant…
A: Hiring the right software engineer is critical to the success of any software development project.…
Q: When evaluating different internet service providers, what are the three most important factors to…
A: Speed and Reliability: The speed and dependability of the internet connection provided by an ISP is…
Q: Write a function to sort an array of integers using the merge sort algorithm. What is the time…
A: def merge_sort(arr): if len(arr) > 1: mid = len(arr) // 2 left_half = arr[:mid]…
Q: How does one input user information into a database?
A: In computer science, databases are commonly used to store and manage large volumes of data…
Q: Each account should have a constant, unique id. Id numbers should start from 1000 and increment by…
A: The requirement states that each account should have a unique ID that starts from 1000 and…
Q: your view, which procedures for the administration of a firewall are the most efficient? Explain.
A: Your answer is given below.
Q: How many socket is/are created in the server and client side? a 1 b 2 c 3 d 4
A: The correct answer is given below
Q: Numerous factors play a role in determining whether or not a network is able to communicate…
A: Because each network is unique in its nature and architecture, there are many different techniques…
Q: Take into consideration the downsides of a weighted graph representation that utilises an adjacency…
A: A weighted graph is a type of graph representation where each edge has a weight or cost associated…
Q: Make a ‘contact us form’ concept and layout for a login website using c#
A: A contact us form is a web-based form that allows users to submit inquiries or messages to the…
Q: There are two different purposes served by the logs of a database. What exactly do you mean by…
A: A database log serves two purposes: to provide a record of database transactions for recovery and to…
Q: What are the best practises for firewall administration?
A: A firewall is a network security system that monitors and controls incoming and outgoing network…
Q: Are there a variety of methods that may be used to process things? Which ones are aligned in a line,…
A: Yes, there are a variety of methods that may be used to process things.
python exercise:
Write a Python function called calculate_average that takes a list of numbers as input and returns the average of the numbers in the list. If the input list is empty, the function should raise an EmptyListError exception.
Handle the case where the input list is empty by raising a custom EmptyListError exception. This exception should have an error message that says "Cannot calculate average of an empty list".
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
- Write the following function that tests whether the list has four consecutive numbers with the same value: def isConsecutiveFour(values):Write a test program that prompts the user to enter a series of integers and reports whether the series contains four consecutive numbers with the same value.A Lo Shu Magic Square is a grid with 3 rows and 3 columns. The Lo Shu Magic Square has these properties: -A grid that contains the numbers 1-9. -The sum of each row, each column, and each diagonal all adding up to the same number. In Python create a program simulatimg the magic square using a two-dimensional list. Additional details: -It must throw an exception if any character other than 1 – 9 is selected. -The program needs to give an message explaining that wrong input has been provided. -The program should prompt the user until the condition has been satisfied. It should prompt the user to enter a number from 1-9. -The program can only use each number once. -When the program starts, it should explain how to play the game. Those who have never heard of it should be able to play. The directions should be clear. -Show an example of a Lo Shu Magic Square after each game. -The program should allow users to play the game until they choose to quit. It also must keep track of wins and…A Lo Shu Magic Square is a grid with 3 rows and 3 columns. The Lo Shu Magic Square has these properties: -A grid that contains the numbers 1-9. -The sum of each row, each column, and each diagonal all adding up to the same number. In Python create a program simulatimg the magic square using a two-dimensional list. Additional details: -It must throw an exception if any character other than 1 – 9 is selected. -The program needs to give an message explaining that wrong input has been provided. -The program should prompt the user until the condition has been satisfied. It should prompt the user to enter a number from 1-9. -The program can only use each number once. -When the program starts, it should explain how to play the game. Users who have never heard of it should be able to play. The directions should be clear. -Show an example of a Lo Shu Magic Square after each game. -The program should allow users to play the game until they choose to quit. It also must keep track…
- This will happen if you try to use an index that is out of range for a list.a. A ValueError exception will occur.b. An IndexError exception will occur.c. The list will be erased and the program will continue to run.d. Nothing—the invalid index will be ignored.Yahtzee! Yahtzee is a dice game that uses five die. There are multiple scoring abilities with the highest being a Yahtzee where all five die are the same. You will simulate rolling five die 777 times while looking for a yahtzee. Program Specifications : Create a list that holds the values of your five die. Populate the list with five random numbers between 1 & 6, the values on a die. Create a function to see if all five values in the list are the same and IF they are, print the phrase "You rolled ##### and its a Yahtzee!" (note: ##### will be replaced with the values in the list) Create a loop that completes the process 777 times, simulating you rolling the 5 die 777 times, checking for Yahtzee, and printing the statement above when a Yahtzee is rolled. When you complete the project please upload your .py file to the Project 2 folder by the due date.A Lo Shu Magic Square is a grid with 3 rows and 3 columns. Create a Lo Shu Magic Square in Python with these properties:-A grid that contains the numbers 1-9.-The sum of each row, each column, and each diagonal all adding up to the same number.-Simulate the magic square using a two-dimensional list.-It must throw an exception if any character other than 1 – 9 is selected.-The program must give an message explaining that wrong input has been provided.-The program has to prompt the user until the condition has been satisfied. It should prompt the user to enter a number from 1-9.-The program can only use each number once.-When the program starts, it must explain how to play the game. Those who have never heard of it should be able to play. The directions should be clear.-Show an example of a Lo Shu Magic Square after each game.-The program must allow users to play the game until they choose to quit.It also must keep track of wins and losses.The user should be given a choice to choose a…
- The function last_words in python takes one parameter, fname, the name of a text file, and returns a list containing the last word from each line of the file. For example, if the file contents are: apples are red bananas are yellow limes are green then the list ["red", "yellow", "green"] should be returned. NOTE: You may assume the file will contain no blank lines. BIG HINT: If line is a string representing a line of text (inside a for loop!), then L = line.split() creates a list of the words in the line. For example: Test Result L = last_words("wordlist1.txt") print(L) ['happy', 'sad', 'angsty', 'euphoric', 'maudlin']Python write a program in python that plays the game of Hangman. When the user plays Hangman, the computer first selects a secret word at random from a list built into the program. The program then prints out a row of dashes asks the user to guess a letter. If the user guesses a letter that is in the word, the word is redisplayed with all instances of that letter shown in the correct positions, along with any letters correctly guessed on previous turns. If the letter does not appear in the word, the user is charged with an incorrect guess. The user keeps guessing letters until either: * the user has correctly guessed all the letters in the word or * the user has made eight incorrect guesses. one for each letter in the secret word and Hangman comes from the fact that incorrect guesses are recorded by drawing an evolving picture of the user being hanged at a scaffold. For each incorrect guess, a new part of a stick-figure body the head, then the body, then each arm, each leg, and finally…Write a program in Java, Python and Lisp When the program first launches, there is a menu which allows the user to select one of the following five options: 1.) Add a guest 2.) Add a room 3.) Add a booking 4.) View bookings 5.) Quit The functionality of these options is as follows: 1.) When users add a guest they provide a name which is stored in some manner of array or list. Guests are assigned a unique ID value where the first guest added is assigned the ID value 1, the second guest added is assigned the ID value 2 and so on. 2.) When users add a room they provide a room number and a room capacity (i.e. how many people can stay in the room at any one time) which is stored in some manner of array or list. Rooms have a property which indicates if they are booked or not for any given date – please see the Room Booking Dates section below for some guidance on the easiest way to implement this. 3.) When users add a booking they provide a guest ID, room number, the number…
- Problem description: Write a python application to simulate an Amazon online book shoppingsystem, namely “Amazing”. Design solution: The template file contains a list of books sold on Amazing, each item in the listcontains the title, publication year, author and the prices. The program will generate anitems_dict where each key is the title of the book and the values will be a list of year, authorand price information. A customer will be presented with a main menu with 4 different options:display all items, add an item to cart, checkout and exit the program. A customer can buy anitem by entering the title of the book. This program implements a dictionary called cart, whereeach key is the title and the values are the list of year, author and price and We assume onecopy is added with each selection. The program keeps repeating by displaying the main menuto user until user hits the quit button. If user hits the checkout option, the program will displayall the items in the cart and display…Phyton: Program 6: Write a program that allows the user to add data from files or by hand. The user may add more data whenever they want. The print also allows the user to display the data and to print the statistics. The data is store in a list. It’s easier if you make the list global so that other functions can access it. You should have the following functions: · add_from_file() – prompts the user for a file and add the data from it. · add_by_hand() – prompts the user to enter data until user type a negative number. · print_stats() – print the stats (min, max, mean, sum). You may use the built-in functions. Handling errors such as whether the input file exist is extra credit. To print a 10-column table, you can use the code below: for i in range(len(data)): print(f"{data[i]:3}", end="") if (i+1)%10==0: print() print() Sample run: Choose an action 1) add data from a file 2) add data by hand 3) print stats 4)…Q1:Write a function that returns a new list by eliminating theduplicate values in the list. Use the following function header:def eliminateDuplicates(lst):Write a test program that reads in a list of integers, invokes the function,and displays the result. Here is the sample run of the program Enter ten numbers: 2 3 2 1 6 3 4 5 2The distinct numbers are: 1 2 3 6 4 5 Q2:Write a program that reads in your Q1 Pythonsource code file and counts the occurrence of each keyword in the file.Your program should prompt the user to enter the Python source code filename. This is the Q1: code: def eliminateDuplictes(lst):newlist = [] search = set() for i in lst: if i not in search: newlist.append(i) search.add(i) return newlist a=[] n= int(input("Enter the Size of the list:")) for x in range(n):item=input("\nEnter element " + str(x+1) + ":") a.append(item) result = eliminateDuplictes(a) print('\nThe distinct numbers are: ',"%s" % (' '.join(result)))