On Sat, Jan 10, 2009 at 6:01 AM, prasad rao wrote:
> Hi
> I tried to print multiplication table using (*args) to pass parameters.and
> tried
> to print tables side by side.But the code looks messy .Is there a better way
> to do it.
> def mtab(*arg):
> for x in range(1,11):
> print '%3d'%(x),'x','
HiI tried to print multiplication table using (*args) to pass parameters.and
tried
to print tables side by side.But the code looks messy .Is there a better way
to do it.
def mtab(*arg):
for x in range(1,11):
print '%3d'%(x),'x','%3d'%(arg[0]),'=','%3d'%(x*arg[0]),(' '*5),\
'%3d'%(x),'x','%3d'%(a