Hey, I got your question. You want a python code for the given question.
As you have not mentioned which python version should I use, I have written the code in Python 3.
The Code for the given question is given below:
# Python 3
# Defining funtion accepptiong 2 arguments
# first argument takes the dictionary
# default argument with value 10, stating the max length of the
bar
def generate_histogram_03(dictData, max_bar_length = 10):
# scale or factor use to multiply the vlues of the
dictionaries
scale = max_bar_length/max(dictData.values())
# list containing the values of new values (multiplied with the
factor)
case = []
for value in dictData.values():
case.append(round(value*scale))
# Printing the results
i=0
for key in dictData:
print(f"{key} {case[i]*'X'}")
i=i+1
print()
data = {'a': 1, 'b': 5,'c': 3}
generate_histogram_03(data, 5)
data = {'a': 1, 'b': 5,'c': 3}
generate_histogram_03(data, 10)
data = {'a': 1, 'b': 5,'c': 3}
generate_histogram_03(data)
data = {'a': 10, 'b': 50,'c': 30}
generate_histogram_03(data)
data = {'a': 10, 'b': 50,'c': 30, 'd': 25, 'e': 1}
generate_histogram_03(data,100)
The proper intended code image is given below:

The output of the code:

As you can see, I have executed the program on all the given test cases and other test cases. I have added comments for the reference.
I hope this will help you. If you have any further query feel free to ask.
use python pls Previously, an X was used to represent every integer value. However, we don't...
STATS Use the R function rnorm() to simulate selecting a random sample of size 25 from a population with mean 80 and s.d. 20. The goal here is to show how contamination affects the mean, s.d., and z-scores. (a) Obtain the sample mean and sample sd of the simulated sample and use them to obtain the z-score for 100. (b) Create the vector contam = c(0,seq(1000,10000,length=21)) To show the effects of contamination, separately add each value of contam to the...
Could anyone help add to my python code? I now need to calculate the mean and median. In this programming assignment you are to extend the program you wrote for Number Stats to determine the median and mode of the numbers read from the file. You are to create a program called numstat2.py that reads a series of integer numbers from a file and determines and displays the following: The name of the file. The sum of the numbers. The...
Lab Objectives Be able to write methods Be able to call methods Be able to declare arrays Be able to fill an array using a loop Be able to access and process data in an array Introduction Methods are commonly used to break a problem down into small manageable pieces. A large task can be broken down into smaller tasks (methods) that contain the details of how to complete that small task. The larger problem is then solved by implementing...
IN PYTHON Assignment Overview This assignment will give you experience on the use of classes. Understand the Application The assignment is to first create a class calledTripleString.TripleStringwill consist of threeinstance attribute strings as its basic data. It will also contain a few instance methods to support that data. Once defined, we will use it to instantiate TripleString objects that can be used in our main program. TripleString will contain three member strings as its main data: string1, string2, and string3....
Use python!!! need to match the execution result that is provided. Part One – Keyword Arguments and Default Values Write an invoice function. The function will generate a simple invoice and will have two required arguments and two keyword arguments. The two required arguments are unitPrice and quantity. The first keyword argument is shipping, and it has a default value of 10. The second keyword argument is handling, and it has a default value of 5. Test it twice from...
Use python!!! need to match the execution result that is provided. Part One – Keyword Arguments and Default Values Write an invoice function. The function will generate a simple invoice and will have two required arguments and two keyword arguments. The two required arguments are unitPrice and quantity. The first keyword argument is shipping, and it has a default value of 10. The second keyword argument is handling, and it has a default value of 5. Test it twice from...
AssignmentBitmap files map three 8-bit (1-byte) color channels per pixel. A pixel is a light-emitting "dot" on your screen. Whenever you buy a new monitor, you will see the pixel configuration by its width and height, such as 1920 x 1080 (1080p) or 3840x2160 (4K). This tells us that we have 1080 rows (height), and each row has 1920 (width) pixels.The bitmap file format is fairly straight forward where we tell the file what our width and height are. When...
In a new file located in the same package as the class Main, create a public Java class to represent a photograph that consists of a linear (not 2D) array of pixels. Each pixel is stored as an integer. The photograph class must have: (a) Two private fields to represent the information stored about the photograph. These are the array of integers and the date the photograph was taken (stored as a String). The values in the array must be...
%%Python Question%% get_min_payment() • Parameters ◦ the total amount of the mortgage (called the principal; should be a positive number) ◦ the annual interest rate (should be a float between 0 and 1) ◦ the term of the mortgage, in years (should be a positive integer; default value: 30) ◦ the number of payments per year (should be a positive integer; default value: 12) • Functionality ◦ Compute the minimum mortgage payment. Should use the formula A= Pr(1+r) n (1+r)...
Course Class Create a class called Course. It will not have a main method; it is a business class. Put in your documentation comments at the top. Be sure to include your name. Course must have the following instance variables named as shown in the table: Variable name Description crn A unique number given each semester to a section (stands for Course Registration Number) subject A 4-letter abbreviation for the course (e.g., ITEC, PHED, CHEM) number A 4-digit number associated...