Re: [Tutor] multiplication table

2009-01-10 Thread Kent Johnson
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','

[Tutor] multiplication table

2009-01-10 Thread prasad rao
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