McWeirdo

November 27th, 2009, 03:25 PM

Hi , I've encountered a problem in python, as I've learned more advanced stuff and skipped the basics I'm missing a simple thing:

I have 2 variables say x and y and I want to print:

" x:value_of_x y:value_of_y"

where the values are the real values of x and y

in C# I would write:

"x:{0} y:{1}",x,y

can't find in py doc the appropriate syntax,

but I think I once saw it's something like that "x:%d y:%d" %x %y

but it doesn't work,it mumbles aboutאטפקד:P

print '+%d*x^%d' %self.data[self.sed-i] %self.sed-i

where sed is integer and the data[index] is integer THE ERROR:

TypeError: not enough arguments for format string

so if anybody could help me ,I would appreciate it.

Thx in advance!!

MCW

I have 2 variables say x and y and I want to print:

" x:value_of_x y:value_of_y"

where the values are the real values of x and y

in C# I would write:

"x:{0} y:{1}",x,y

can't find in py doc the appropriate syntax,

but I think I once saw it's something like that "x:%d y:%d" %x %y

but it doesn't work,it mumbles aboutאטפקד:P

print '+%d*x^%d' %self.data[self.sed-i] %self.sed-i

where sed is integer and the data[index] is integer THE ERROR:

TypeError: not enough arguments for format string

so if anybody could help me ,I would appreciate it.

Thx in advance!!

MCW