Computers and Technology

Write a program to define a Superhero class, set attributes and call the methods. Use the following guidelines to write your program: Look over the code that starts the Superhero class. You may use this code as a starting point. Come up with two additional attributes and one method to add to the class. Be creative! Some attributes could be a motto, villain, strength, weakness, or alter ego. An action might be saveWorld() or transformHero().
class Superhero:

# Superhero class represents the facts related to a superhero.

def __init__(self, name = "", strengthPts = 0):

# Create a new Superhero with a name and other attributes.

self. name = name
self. strengthPts = strengthPts

def addStrengthPts(self, points):

# Adds points to the superhero's strength.

self. strengthPts = self. strengthPts + points

Update the class by including at least two new attributes and one new method.
In the main() method, create your superhero. Be sure to assign values to its attributes and call its methods.
Create output that describes your superhero in a story fashion or a series of events.
Write the pseudocode for this program. Be sure to include any needed input, calculations, and output.
Please help me write a input and the output for this code using python idle.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:20, babyrocks7300
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
image
Computers and Technology, 23.06.2019 11:30, kyraj21
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
image
Computers and Technology, 24.06.2019 13:00, pineapplepizaaaaa
If you add the following to the query grid in an access query, what is it called? salestaxamt: [salestaxrate]*[totalsale] formula calculated field total calculation
Answers: 2
image
Computers and Technology, 24.06.2019 16:50, Laylahlettiere
Develop the program incrementally: a) start by reading and displaying each line of the input file to make sure you are reading the data set correctly. b) use the split string method to extract information from each line into a list. print the list to prove that this step is working correctly. d) convert the exam scores to type int and calculate the studentโ€™s average. display those items to prove this step is working correctly. e) create a tuple containing the six items for each student (name, exam scores, exam mean). display the tuples to prove this step is working correctly. (optionally, you may want to have the exam scores in a list so your tuple is (name, scores_list, f) append each tuple to a list. display the list to prove this step is working correctly. g) use the sort list method to re-order the tuples in the list. display the list to prove this step is working correctly. h) use a for statement to display the contents of the list as a table (with appropriate formatting). i) use a for statement to calculate the average of all scores on exam #1, then display the results. note that you could have calculated this average within the first loop, but we are explicitly requiring you to do this calculation by looping though your list of tuples. j) add the logic to calculate the average of all scores on exam #2, then display the results.
Answers: 2
Do you know the correct answer?
Write a program to define a Superhero class, set attributes and call the methods. Use the following...

Questions in other subjects: