Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In Python: #Q3: We want to plot the a class Player with attributes name and age.

ID: 3908422 • Letter: I

Question

In Python:

#Q3: We want to plot the a class Player with attributes name and age.
# then we want to creat a subclass of Player called defender,
# at the end, we creat an object from each classes.
# 2 points
import random
import pygal

data = '?' # create an empty list
for i in range(10001):
x= random.'?'(1,10) # create a random integer number between 1 and 10.
data.append(x)
frequencis = []
for i in set(data):
frequency = data.'?'(i) # find how many i is avalible in data
frequency = frequency/len(data)
frequencis.append(frequency)
  
Hist = '?' # plot pygal bar chart.
Hist.'?' = 'Frequencey of random numbers (in %)' # this is title of the bar chart.
Hist.add('freq',frequencis)
Hist.'?'('freq.svg') #save the result.

# also, you an plot a pie chart using pygal, check the file :-)
piec = pygal.Pie()
for value in list(range(1,11)):
piec.add(str(value),frequencis[value-1])
piec.render_to_file('Piefreq.svg')

Explanation / Answer

=============================================

Above code should run fine as per instructions. I dont have this module installed, so i can not provide a sample output,

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote