Hi<div>I tried to print multiplication table using (*args) to pass parameters.and tried&nbsp;</div><div>to print tables side by side.But the code looks messy .Is there a better way to do it.</div><div><br></div><div><div>def mtab(*arg):</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>for x in range(1,11):</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;print &#39;%3d&#39;%(x),&#39;x&#39;,&#39;%3d&#39;%(arg[0]),&#39;=&#39;,&#39;%3d&#39;%(x*arg[0]),(&#39; &#39;*5),\</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>&#39;%3d&#39;%(x),&#39;x&#39;,&#39;%3d&#39;%(arg[1]),&#39;=&#39;,&#39;%3d&#39;%(x*arg[1]),(&#39; &#39;*5),\</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&#39;%3d&#39;%(x),&#39;x&#39;,&#39;%3d&#39;%(arg[2]),&#39;=&#39;,&#39;%3d&#39;%(x*arg[2]),(&#39; &#39;*5)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>print((&#39;-&#39;)*10).center(78)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>for x in range (1,11):</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;print &#39;%3d&#39;%(x),&#39;x&#39;,&#39;%3d&#39;%(arg[3]),&#39;=&#39;,&#39;%3d&#39;%(x*arg[3]),(&#39; &#39;*5),\</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>&#39;%3d&#39;%(x),&#39;x&#39;,&#39;%3d&#39;%(arg[4]),&#39;=&#39;,&#39;%3d&#39;%(x*arg[4]),(&#39; &#39;*5),\</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&#39;%3d&#39;%(x),&#39;x&#39;,&#39;%3d&#39;%(arg[5]),&#39;=&#39;,&#39;%3d&#39;%(x*arg[5]),(&#39; &#39;*5)</div>
<div>Prasad</div></div>