[Tutor] How to split something?
Alan Ting
xting at sbcglobal.net
Sun Jan 29 04:52:00 CET 2012
Hello,
How do I get the characters to separate?
This is what I did.
def personalNote(name):
'Print a personalized love note'
x = (name)
print (x + ", I love you so.")
print ("You brighten my day.")
print ("Oh, " + x + "!")
print ("I wish you could be with me always")
Write a function personalNote() that takes as
input a name (as a string) and prints a love note as follows:
>>> personalNote('Joon')
Joon, I love you so.
You brighten my day.
Oh, J O O N !
I wish you could be with me always.
But alas, Joon, you must stay away.
>>> personalNote('Djengo')
Djengo, I love you so.
You brighten my day.
Oh, D J E N G O!
I wish you could be with me always.
But alas, Djengo, you must stay away.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120128/36160663/attachment-0001.html>
More information about the Tutor
mailing list