I have program that is turning sensor measurements into a .xyz file. 
To do this, it has to write to the file in the form x y z \n
I'm using the following line of code 

`f.write('{0:f} 0 {0:f}\n'.format(xpos,zpos))`

`xpos` and `zpos` are both floats 

I was expecting the output to the file to be 

> 
> xpos 0 zpos 
> 
> 
> 

but instead i'm getting 

> 
> xpos 0 xpos 
> 
> 
> 

I'm not sure why, and I'm not sure any alternative to using format either.