Home /
Expert Answers /
Computer Science /
python-using-tkinter-write-a-program-that-defines-a-class-named-player-meeting-the-following-specifi-pa280
(Solved): Python using tkinter Write a program that defines a class named Player meeting the following specifi ...
Python using tkinter
Write a program that defines a class named Player meeting the following specifications: 1. The Player should have three attributes: - an attribute called name which holds the name of the player - an attribute xp which holds the player's current experience points - an attribute called distance of type double which holds the player's current distance from the spawn point 2. The Player class should have an __init__ method that has parameters for all fields. The default value for the xp attribute should be 0 . The default value for the distance attribute should be 0.0 . 3. The Player class should have a __str__- method that returns a string that displays the values of all attributes. In addition, the program should create two Player objects, one using the default values and the other using non-default values. The program should print the Player objects.