How to add function output to string literal in Python?
<p>I'm new to Python. Just putting that out there.</p>

<p>What I want to do is to add the output of a function to a string literal that another function outputs.</p>

<p>This is the case:</p>

<p>**</p>

<pre><code>def prime(n):
    **blahh blah blah....**
    if z == True:
        return " and prime"
    else:
        return ""
def happyPrime(n):
     **more blah blah blah**
            if n == 1:
                print ("Number is happy%s!" % prime)
                break
            if n in visited:
                print ("Number is sad%s!" % prime)
            visited.add(n)
</code></pre>

<p>[Ignore the indentations in the code snippet, StackOverflow made them come out wrong.]
The intended result is, of course, that where the modulo is it adds what the other function returned. I think I may be approaching it the wrong way, though.</p>
