Please help me write the code using PYTHON
Q: python code complete the code code and output show
A: Here You have to use lambda expression to find squares of number in list sum() is used to find sum…
Q: 2.2: Operations on a list Suppose we have these iterable inputs and their corresponding A,B,C…
A: Description: The poly method can be defined as follows: Initialize a tuple, output_tuple. Iterate…
Q: Q#1: Write a program that prints the numbers from 1 to 1000 On the same line it should also print…
A: Program plan: Create a function name printSquare() loop from i=1 to 1000 print(str(i)+". Squared…
Q: I need this code to be in python please
A: According to the information given;- We have to follow the instruction in order to get the desired…
Q: Write a program named "StockPrice.py" that analyzes stock market price for a list of firms, The…
A: Required:
Q: Recall the simple calculator program shown in class, which had ADD, SUBTRACT, MULTIPLY and DIVIDE…
A: The operator can be defined as a symbol which is responsible for a particular operation between two…
Q: 1. Kilometer Converter Write a program that asks the user to enter a distance in kilometers, then…
A: Both python programs are coded in the next steps.
Q: get pattern() returns 5 characters. Call get pattern() twice in print() statements to return and…
A: The algorithm of the code: 1. Define a function, named ‘get_pattern’. 2. Inside the function, return…
Q: Write a program which performs a breadth-first search to find the solution to any given board…
A: Python program that performs a breadth-first search to find the solution to any given board position…
Q: class CircularArray: definit_(self, lin, st, sz): #Initializing Variables self.start = 0 self.size =…
A: Solution: Given,
Q: Write a class called quadratic that is derived from linear class to represents a quadratic equation…
A: The standard form of quadratic equation is cx^2+bx+a=0.Here, a, b and c are coefficients and the…
Q: 1. Rock-paper and scissors game Take the name of the user1 and user2 Ask "do you want to choose…
A: def start_game(): user1 = input('Enter name of user 1 : ') #taking user 1's name user2 =…
Q: Write the code from the following flow chart. Greater than 5 Randomly initialize a list counter = 0…
A: Conversion of flow-chart to python code : The python program generates a random list of numbers.…
Q: this question, you will be given a list of integers, and you have to write in a text file named…
A: solution Logic: As we can see, 3 whitespace first column and 3 "|" second column. A white area and…
Q: 6. Averaging a) Define a function average() with a parameter grades that can accept an arbitrary…
A: Hi. Let's move on to the code in the next step. I have included comments in the code that will…
Q: Elena complains that the recursive newton function in Project 2 includes an extra argument for the…
A: code:
Q: I this question, you will be given a list of integers, and you have to write in a text file named…
A: #solution: #python code: #define the function # the fuction takes list l as the parameterdef…
Q: Write a Python program that reads each line of an input file temperatures.txt that consists of a…
A: Please find the code below::
Q: Stadium Seating Revenue Calculation Tool Class A Seats were sold? 1 Class B Seats were sold? 2 Class…
A: PROGRAM/CODE : - from tkinter import * class MyWindow: def __init__(self, win): #…
Q: expample: Creat a hash table and ask the user to input a value (the value can be any data type but…
A: Hash table in python code . apply linear probing to solve collision
Q: Write one line of code for each of the following: 1) Create a list named nums with the following…
A: insert(index,value): It is used to insert the value at particular index. append(value): It insert…
Q: he nth Fibonacci Number can be calculated using the following formula: V5 2 reate a function with…
A: import math # calculate nth Fibonacci numberdef fib(int1): sqrt5 = math.sqrt(5) # ((1 + V5)/2)^n…
Q: I need help creating a python code described below
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT…
Q: Given: f(x) = 2 ln 38-2 38 0.0088.x. Provide code that will solve the following: a. Compute f f(x)…
A: 1. Import the necessary module `integrate` from the `scipy` library and the `math` module.2. Define…
Q: Consider an mxn grid such as the one shown below. From each numbered square, one may move that exact…
A: # Python program to count of ways to place 1 x 4 tiles # on n x 4 grid. # Returns count of count…
Q: b) Implement a recursive algorithm to add all the elements of a non-dummy headed singly linked…
A: Python Code: class Node: # Constructor to initialize the node object def __init__(self, data):…
Q: Write a code to count and print the number of "@" character in the file "myfile.txt".
A: Algorithm : Step 1 : open the file "myfile.txt" in read mode. Step 2 : read the lines from file and…
Q: Write a class called linear to represents a linear equation (ax+b = 0). The class has a constructor…
A: Python code for above : # required class class linear: # constructor def __init__(self,…
Q: Complete the below function that takes a file name and a list as arguments and reads the text within…
A: Program Approach: Create the empty dictionary which will store the count of characters. Use the…
Q: 2.8*189] = [8.0*1e**9, rate = [(e.07, 8.08, e.09, e.10, e.11, e.12] multiplier = 1/100 for i in…
A: Please find the answer below :
Q: Complete the below function which takes two circles as tuples, and returns True if the circles…
A: Formula to check if two circles intersect using the below formula: If (x1,y1) and (x2,y2) are…
Q: 3.30 LAB: A Jiffy Jiffy is the scientific name for 1/100th of a second. Define a function named…
A: algorithm:- read number of jiffies define jiffies_to_seconds(pass jiffies from outside):return…
Q: QUESTION 2 Write one line of code ONLY. Print the value of gpa and its data type in two separate…
A: Step-1: Start Step-2: Declare a variable gpa with value 99.99 Step-3: Print the value of gpa Step-4:…
Q: TASK 3 (25 points) [Testing: Variables and expression, strings, conditional-statements, loops]…
A:
Q: You must use Python to solve all of the following problems, except the first one, for which you may…
A: The answer is given below:
Q: definit_(self, lin, st, sz): # Initializing Variables self.start = st self.size = sz self.cir =…
A: Answer: We need to write the remaining code and we have done in python code and also have attached…
Q: 12. Stock Transaction Program Last month, Joe purchased some stock in Acme Software, Inc. Here are…
A: 1. Define Initial Values: - Initialize variables with the given data, such as `shares_purchased`,…
Please help me write the code using PYTHON
![PROBLEM 1: Calculate Sales
Function Name: calculateSales()
Parameters:
item - a string representing the name of the item for which you want to calculate the
total sales
Return Value: str
Description: Given a file, grocery_sales.csv (found on canvas and shown in the image
below), find the given item and calculate the total sales for that item (i.e., quantitySold *
pricePerltem). If the item does not exist in the file, the function should return 'Item not found'.
grocery_sales.csv:
itemName, quantitySold, pricePerItem
Apples, 25,0.5
Bread, 30, 2
Oranges, 50,0.6
Milk, 40, 1.5
Eggs, 60, 0.2
Cheese, 20,3
Tomatoes, 35,0.75
Lettuce, 45,1
Chicken, 10,5
Beef, 15, 6
Cereals, 28,3.5
Rice, 50, 0.9
Pasta, 40, 1.25
Chocolate, 55, 1
Coffee, 30,4
Test Cases:
>>> print (calculateSales ("Apples"))
Sales Total: $12.50
>>> print (calculateSales ("Bread"))
Sales Total: $60.00
>>> print (calculateSales ("Onions"))
Item not found.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F11adb83d-8871-41e5-bb97-2ea571aa0e6e%2F6f8a6d3d-c347-4444-8b63-24d7a6706991%2Frr0l81l_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
- Assignment 5C: Level Map Creator. There are a variety of ways that game developers store their level layouts. One simple method is to associate level elements with certain symbols, and then storing them in a 2D grid inside a text file. We will use our knowledge of 2D arrays to create a very simple Level Map Creator tool. The program should prompt the user to enter a width and height for the level. Then it should initialize a 2D array and fill every element with the "*" symbol. Afterwards, the user should be given the following options via a menu: 1. Clear Level Re-initialize the 2D array and fill every element with the "*" symbol. 2. Add Platform Prompt the user to enter a starting point and length for the horizontal platform. Replace those elements in the 2D array with the "=" symbol. If the length is longer than the number of columns (or out of bounds), notify the user that this is not possible. 3. Add Item Prompt the user to enter a column and row index. Replace that element in the…Assignment 5C: Level Map Creator. There are a variety of ways that game developers store their level layouts. One simple method is to associate level elements with certain symbols, and then storing them in a 2D grid inside a text file. We will use our knowledge of 2D arrays to create a very simple Level Map Creator tool. The program should prompt the user to enter a width and height for the level. Then it should initialize a 2D array and fill every element with the *" symbol. Afterwards, the user should be given the following options via a menu: 1. Clear Level 2. Add Platform Prompt the user to enter a starting point and length for the Re-initialize the 2D array and fill every element with the "** symbol. horizontal platform. Replace those elements in the 2D array with the "=" symbol. If the length is longer than the number of columns |(or out of bounds), notify the user that this is not possible. Prompt the user to enter a column and row index. Replace that element in the 2D array…C++HurdleWords The HurdleWords class is mostly provided to you. HurdleWords is constructed from two files in the data/ folder: ● valid_guesses.txt (all 5 letter guesses considered to be valid words to guess), and ● valid_hurdles.txt (all words that may be selected to be the secret Hurdle.) ● Note: you may edit both text files if you’d like to add custom words to your game. HurdleWords stores all potential valid Hurdles from valid_hurdles.txt into a vector of strings (valid_hurdles_), and all valid guesses from valid_guesses.txt into an unordered set of strings (valid_guesses_). A set is simply a data structure that contains no duplicates and allows for a speedy lookup to check if a given element exists within the set. Because there are over 10,000 valid guesses, we store them in an unordered set to leverage their speediness, as you will need to check if a user-submitted guess is considered valid (i.e. their guess is considered a valid guess in the dictionary). You are responsible for…
- Fleet class: Instance Variables An array that stores Aircraft that represents Delta Airlines entire fleet A variable that represents the count for the number of aircraft in the fleet Methods: o Constructor-One constructor that instantiates the array and sets the count to aero readFile()-This method accepts a string that represents the name of the file to be read. It will then read the file. Once the data is read, it should create an aircraft and then pass the vehicle to the addAircraft method. It should not allow any duplication of records. Be sure to handle all exceptions. o writeFile()-This method accepts a string that represents the name of the file to be written to and then writes the contents of the array to a file. This method should call a sort method to sort the amay before writing to it. sortArray()-This method returns a sorted array. The array is sorted by registration number.u addAircraft- This method accepts an aircraft and adds it to the fleet(the array only if it is not…7. World Series Winners In this chapter's source code folder (available on the Computer Science Portal at www. pearsonhighered.com/gaddis), you will find a text file named WorldSeriesWinners. txt. This file contains a chronological list of the World Series' winning teams from 1903 through 2009. The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2009. (Note the World Series was not played in 1904 or 1994. There are entries in the file indicating this.) Write a program that reads this file and creates a dictionary in which the keys are the names of the teams, and each key's associated value is the number of times the team has won the World Series. The program should also create a dictionary in which the keys are the years, and each key's associated value is the name of the team that won that year. The program should prompt the user for a year in the range of 1903 through 2009. It should then display the name of the…use windows form app
- Comment block: Set up comments using the standard format in a <# and #> container, which should contain a synopsis, description, and at least one example which shows how to run the script. Set up an array: Put values in the array $ComputerNames, containing the names of two computers: DC1 and W10-CLIENT. Prompt for user's name: Use the text Please enter your first name, store the value the user will provide in a variable named $FirstName, and write out the text Hello followed by a space, followed by the name entered. Prompt for report type, and store value provided: Ask the user to enter AD if the information on Active Directory Users is required, and WMI for Windows Machine Instrumentation. Store the answer provided in variable $ReportType Confirm report selection: If an Active Directory report was requested, on a new line print the message "A list of all AD users was requested for computers " followed by the contents of the $ComputerNames array. If a Windows Machine…Python Programming QuestionA __________ is a data type you can create that contains one or more variables known as fields. a. structure b. collection c. volume d. list
- Function for button "Publishing Date": • Name this function by your last name (for example, function yamoutl)). When the user clicks on the button "Publishing Date" (after filling all the textboxes), the current date and time will be printed after the text "Published on:" CSCI375 Grades Exam-1 (70 Exam-2 98 Project 86 Exam-3 80 Show the Grades Your Grades: Exam-1 - 78, Exam-2 - 98, Project - 85, Exam-3 - 80 Publishing Date Published on: 5/10/2021, 5:39:08 PM Change Background ColorMicrosoft Visual C# 7th edition. need help, please. Thanks In previous chapters, you created applications for Marshall’s Murals. Now, modify the version of the MarshallsRevenue program created in Chapter 5 so that after mural data entry is complete, the user is prompted for the appropriate number of customer names for both the interior and exterior murals and a code for each that indicates the mural style: L for landscape S for seascape A for abstract C for children’s O for other When a code is invalid, re-prompt the user for a valid code continuously. For example, if Y is input, output Y is not a valid code, and re-prompt the user until a valid code is entered. After data entry is complete, display a count of each type of mural. For example the output should be in the following format with the correct number next to each mural type: The interior murals scheduled are: Landscape 1 Seascape 2 Abstract 1 Children's 3 Other 9 The exterior murals scheduled are: Landscape 4 Seascape 0…Chapter 7 - Programming Challenge 15 15. World Series Champions If you have downloaded this book’s source code (the companion Web site is available at www.pearsonhighered.com/gaddis), you will find a file named WorldSeriesWinners.txt. This file contains a chronological list of the winning teams in the World Series from 1903 through 2009. (The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2009. Note that the World Series was not played in 1904 or 1994, so those years are skipped in the file.) Write a program that lets the user enter the name of a team, and then displays the number of times that team has won the World Series in the time period from 1903 through 2009. Tip: Read the contents of the WorldSeriesWinners.txt file into an ArrayList. When the user enters the name of a team, the program should step through the ArrayList, counting the number of times the selected team appears You only need to submit the…
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)