1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
maria [59]
3 years ago
11

Provide a class Letter for authoring a simple letter. In the constructor, supply the names of the sender and the recipient: def

__init__(self, letterFrom, letterTo) Supply a method
Computers and Technology
1 answer:
STatiana [176]3 years ago
4 0

Answer:

class Letter:

   header="Dear "

   footer="Sincerely, \n"

   text=""

   def __init__(self,letterFrom,letterTo):

       self.header+=letterTo + ":\n\n"

       self.footer+=letterFrom + "\n"

   

   def getText(self):

       return self.header+self.text+self.footer

   def addLine(self,line):

       self.text+=line+"\n\n"

l = Letter("Cain", "Abel")

l.addLine("I am very happy to be writing to you at this joyful moment of my life.")

I.addLine("I am really sorry i killed you, I was a saddist back then.")

print(l.getText())

Explanation:

The Letter class a used to write a letter. The magic method "__init__" is used as a constructor to accept the sender and the recipient of the letter. The addLine method is called on an instance of the class to add string lines to the object while the getText method returns the entire written letter.

You might be interested in
A deleted file or folder is not permanently deleted from a computer until which event occurs?
Dimas [21]

Answer:

The computer is restarted. The Recycle Bin or Trash is emptied

Explanation:

8 0
2 years ago
Data entry is the process of getting information into a database. true false
Keith_Richards [23]
Yes it's the process of entering data into a database.
6 0
3 years ago
Read 2 more answers
Which windows system include new features and extends the functionality
Juli2301 [7.4K]

Critical update

Hope this helps!

3 0
2 years ago
Which of the four digital-to-analog conversion techniques (ASK, FSK, PSK or QAM) is the most susceptible to noise? Defend your a
grigory [225]

Answer:

ASK

Explanation:

The correct answer is ASK which denotes Amplitude Shift Keying. This is essentially a type of amplitude modulation which represents the binary data that comes varied forms right in the amplitude of a signal.

Now the reason why It is the most susceptible technique to noise is due to the fact that between frequency, phase & amplitude, amplitude is the one that is most susceptible to being affected by noise when compared to the other two.

3 0
2 years ago
Which property do you use to align an element horizontally with the left or right edge of its parent element?
Ugo [173]
A thank me later:) give me hearts
3 0
2 years ago
Other questions:
  • What are some good job skills?
    12·1 answer
  • Write a program in java that reads each line in a file, reverses its characters, and writes the resulting line to another file
    15·1 answer
  • Casey, a woodworker, is developing his own website. He plans to use the site as a means of selling his handmade furniture. While
    10·1 answer
  • Write the proghrams for the following:
    13·1 answer
  • ____________ is used by IM and other applications that provide voice services over lower-speed digital circuits.
    15·1 answer
  • IN C++ PLEASE!!!! Define a function FilterStr() that takes a string parameter and returns "Good" if the character at index 4 in
    7·1 answer
  • Use the drop-down tool to select the word or phrase that completes each sentence.
    7·1 answer
  • If you would like to give another user permissions on your mailbox or to particular folders within your mailbox, which role shou
    10·1 answer
  • Five uses of the operating system​
    10·2 answers
  • Type the correct answer in the box
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!