How to use SEP in for loop? : <p>I can't sep="_" in my code</p>

<p>How can i do.</p>

<pre><code>'''python'''
def sequence(num):
    for i in range(1, num+1):
        print(i, sep="_", end=""
sequence()
</code></pre>

<pre><code>num = 6
i want = 1_2_3_4_5_6
but it show = 123456
</code></pre>
