Question: Formatting Strings (3.py) Getting current time: # !/usr/bin/env python # -*- coding: utf-8 -*- import datetime def now(): return datetime.datetime.now().strftime('%d %B %Y %I:%M:%S %p') Given
Formatting Strings (3.py)
Getting current time:
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime def now(): return datetime.datetime.now().strftime('%d %B %Y %I:%M:%S %p') Given string values for the sender, recipient, and subject of an email, implement a function email(sender, recipient, subject) that format those information and prints as shown here:
>>> sender = 'tim@abc.com' >>> recipient = 'tom@xyz.org' >>> subject = 'Hello!' >>> email(sender, recipient, subject) From: tim@abc.com To: tom@xyz.org Subject: Hello! Sent: 13 September 2018 09:30:00 AM
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
