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

I need help with this 2 questions and the answers have to be in Python 3.x. Plea

ID: 3859194 • Letter: I

Question

I need help with this 2 questions and the answers have to be in Python 3.x. Please help. Thank you!

7. Provide a class for authoring a simple letter. In the constructor, supply the names of the sender and the recipient: der-init-(self, letterFrom, etterTo) Supply a method def addLine(self, line) to add a line of text to the body of the letter. Supply a method def getText(self) that returns the entire text of the letter. The text has the form: Dear recipient name: blank line first line of the body second line of the body last line of the body blank line Sincerely, blank line sender name Also supply a driver program that prints the following letter: Dear John: 1 I am sorry we must part. I wish you all the best. Sincerely, Mary Construct an object of the Letter class and call addLine twice. 2. Design a class called Color. The fields of the class are three decimals for Red, Green, and Blue components in the range 0 to 1, inclusive (0 indicates Black and 1 indi- cates White). Add checks to ensure that the values are always in the given range Provide addition and subtraction operators for the color class. Include saturation in the addition and subtraction: if any component goes less than 0 or greater than 1, assign them 0 or 1, respectively.

Explanation / Answer

import smtplib def sendemail(from_addr, to_addr_list, cc_addr_list, subject, message, login, password, smtpserver='smtp.gm.com:587'): header = 'From: %s ' % from_addr header += 'To: %s ' % ','.join(to_addr_list) header += 'Cc: %s ' % ','.join(cc_addr_list) header += 'Subject: %s ' % subject message = header + message server = smtplib.SMTP(smtpserver) server.starttls() server.login(login,password) problems = server.sendmail(from_addr, to_addr_list, message) server.quit()