I need help fixing a python code that should display in the given image below.
:
class Team:
def __init__(self):
self.team_name = 'none'
self.team_wins = 0
self.team_losses = 0
def get_win_percentage(self):
return self.team_wins / (self.team_wins + self.team_losses)
if __name__ == "__main__":
team = Team()
team_name = input()
team_wins = int(input())
team_losses = int(input())
team.team_name = team_name
team.team_wins = team_wins
team.team_losses = team_losses
if team.get_win_percentage() >= 0.5:
print('Win Percentage: ',(team.get_win_percentage()))
print('Congratulations, Team', team.team_name, 'has a winning average!')
else:
print('Team', team.team_name, 'has a losing average.')
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images
- In python and include doctring: First, write a class named Movie that has four data members: title, genre, director, and year. It should have: an init method that takes as arguments the title, genre, director, and year (in that order) and assigns them to the data members. The year is an integer and the others are strings. get methods for each of the data members (get_title, get_genre, get_director, and get_year). Next write a class named StreamingService that has two data members: name and catalog. the catalog is a dictionary of Movies, with the titles as the keys and the Movie objects as the corresponding values (you can assume there aren't any Movies with the same title). The StreamingService class should have: an init method that takes the name as an argument, and assigns it to the name data member. The catalog data member should be initialized to an empty dictionary. get methods for each of the data members (get_name and get_catalog). a method named add_movie that takes a Movie…arrow_forwardProgram - Python This is my program for a horse race class (Problem below code) class Race: def __init__(self,name,time): self.name = name self.time = time self.entries = [] class Entrant: def __init__(self,horsename,jockeyname): self.horsename = horsename self.jockeyname = jockeyname race1 = Race('RACE 1','10:00 AM May 12, 2021')race2 = Race('RACE 2','11:00 AM May 12, 2021')race3 = Race('RACE 3','12:00 PM May 12, 2021') race1.entries.append(Entrant('Misty Spirit','John Valazquez'))race1.entries.append(Entrant('Frankly I’m Kidding','Mike E Smith')) race2.entries.append(Entrant('Rage against the Machine','Russell Baze')) race3.entries.append(Entrant('Secretariat','Bill Shoemaker'))race3.entries.append(Entrant('Man o War','David A Gall'))race3.entries.append(Entrant('Seabiscuit','Angel Cordero Jr')) print(race1.name, race1.time)for entry in race1.entries: print('Horse:',entry.horsename) print('Jockey:',entry.jockeyname) print()…arrow_forwardIn C# Use a one-dimensional array to solve the following problem. Write a class called ScoreFinder. This class receives a single dimensional integer array representing passer ratings for NFL players as an argument for its constructor. The test class will provides this argument. The test class then calls upon a method from the ScoreFinder class to start the process of finding a specific rating, which will be provided by the user. The method will iterate through the array and find any matching values. For all the matches that are found, the method will note the index of the cell along with its value. At completion, the method will print a list of all the indices and the associated scores along with a count of all the matching values.arrow_forward
- Write a class in pythonarrow_forwardMust be in C++ and cannot come from any online source. Please include all requested parts in problem. Create a class named Employee that has the following member variables: name - a string that holds the employee's name empIdNumber - an int variable that holds the employee's ID Number job - a string that holds the name of the position the employee is working in (Laborer, Manager, Secretary, etc.) yearsOfService- an integer that holds the employee's years of service The class should have the following constructors: A constructor with the following values as parameter arguments and assigns them to the appropriate member variables: employee's name, employee ID number, job and years of service that are passed to them when the object is created (pass each of the four values into the constructor) A constructor with the following values as parameter arguments and assigns them to the appropriate member variables: employee's name and ID Number. The job field should be assigned an…arrow_forwardIn Python code: Using this website: https://en.wikipedia.org/wiki/Greenhouse_gasCreate a named tuple to contain each Gas Concentration data for these columns: Gas,Pre-1750,Recent,Absolute increase since 1750,Percentage increase since 1750. Design a class to hold this named tuple and add necessary dunders to support initialization, string conversion, sorting by a specific column (like 'Recent' for example) and searching.arrow_forward
- Program - PythonThis is my code for a class. (Question below code)class Pizza:def __init__(self, name):self.name = nameself.toppings = []self.order_status = "Not Ordered"def set_toppings(self, topping_list):self.toppings = topping_listdef get_order_status(self):return self.order_statusdef set_order_status(self, status):self.order_status = status suzie = Pizza("Suzie")larry = Pizza("Larry")suzie_toppings = ["Pepperoni", "Mushroom", "Onion", "Sausage"]suzie.set_toppings(suzie_toppings)suzie.set_order_status("Ordered")larry_toppings = ["Ham", "Pineapple", "Jalapeno", "Olives"]larry.set_toppings(larry_toppings)larry.set_order_status("Ordered")print("Suzie's Order:")print(f"Toppings: {suzie.toppings}")print(f"Order Status: {suzie.get_order_status()}")print("\nLarry's Order:")print(f"Toppings: {larry.toppings}")print(f"Order Status: {larry.get_order_status()}") Question: Create two instance, a first and a second instance with a demo and how it can be used. Then create a menu interface for…arrow_forwardIn C++ Create a class called Student. Each student should have a name and ID number (an int). They should also have a ptr to a dynamic array called Grades. The public methods for Student should be: getName, setName, getID, setID, setGrades, getGrades. In the constructor you should initialize Grades to be an array of size 4 with the values 0 for each position. Make sure that you use THIS properly. Create 2 students, assign one object to another and show that when you assign grades to one it effects the other equally.arrow_forward/*** This class describes a tweet. A tweet has a message in it, a unique ID,* a count of the number of likes, and a count of the number of times it* has been retweeted. In addition, the Tweet class will have a static * variable to count the total number of tweets to ever be created * (retweets don't count as a new tweet).* * You may NOT import any library class.* * **/public class Tweet { /*** This constructor creates a tweet with the given message.* Assume that the message is not null because only the tweet() method* from the TwitterUser class will call this constructor. There are* no length requirements on Tweets.* * The very first tweet to ever be created will have an ID of 0, the * next one will have 1, and so on and so forth. It may help you to use* the static count variable to set the ID. * * You will have to initialize other instance variables appropriately.* @param message the text of the tweet*/public Tweet(String message) {throw new UnsupportedOperationException("Implement…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education