So I've written a code to get an acronym of the phrase inputed by the user. The only problem is that it insert an extra line in the result which I don't need. I'm not sure what is causing it. Here is the code and the results:
import string
def acronym(phrase):
x = ""
phrase = string.capwords(phrase)
for phrase in phrase.split():
x = x + phrase[0]
print "The acronym is", x
return acronym
def main():
phrase = raw_input("Enter a phrase: ")
print acronym(phrase)
main()
>>>
Enter a phrase: Dani Web
The acronym is DW
<function acronym at 0x00C4D1B0>
>>>