Hi<div>I tried to print multiplication table using (*args) to pass parameters.and tried </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> print '%3d'%(x),'x','%3d'%(arg[0]),'=','%3d'%(x*arg[0]),(' '*5),\</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>'%3d'%(x),'x','%3d'%(arg[1]),'=','%3d'%(x*arg[1]),(' '*5),\</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>'%3d'%(x),'x','%3d'%(arg[2]),'=','%3d'%(x*arg[2]),(' '*5)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>print(('-')*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> print '%3d'%(x),'x','%3d'%(arg[3]),'=','%3d'%(x*arg[3]),(' '*5),\</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>'%3d'%(x),'x','%3d'%(arg[4]),'=','%3d'%(x*arg[4]),(' '*5),\</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>'%3d'%(x),'x','%3d'%(arg[5]),'=','%3d'%(x*arg[5]),(' '*5)</div>
<div>Prasad</div></div>