Re: concat string and dict in print statement

2014-12-05 Thread Ian Kelly
On Fri, Dec 5, 2014 at 10:31 AM, wrote: > > Hi Guys, > > I am trying to combine string and dict in the print statement, however getting an error. Would someone let me know what will be correct way to do that. > > stats={'lname': 'shah', 'fname': 'gaurang'} > a=test > > print "%s %(fname)s %(lname)

Re: concat string and dict in print statement

2014-12-05 Thread Peter Otten
gaurangns...@gmail.com wrote: > I am trying to combine string and dict in the print statement, however > getting an error. Would someone let me know what will be correct way to do > that. > > stats={'lname': 'shah', 'fname': 'gaurang'} > a=test > > print "%s %(fname)s %(lname)s" %(a,stats) > >

concat string and dict in print statement

2014-12-05 Thread gaurangnshah
Hi Guys, I am trying to combine string and dict in the print statement, however getting an error. Would someone let me know what will be correct way to do that. stats={'lname': 'shah', 'fname': 'gaurang'} a=test print "%s %(fname)s %(lname)s" %(a,stats) Following is the error I am getting Tr