How do you escape % when formatting a string?

2007-04-02 Thread erikcw
Hi, I'm trying to format a string like so: string = You have a 75% chance of success with %s, don't use %s %(a, b) This gives me: TypeError: not enough arguments for format string I've tried 75\%, but that doesn't seem to help. What am I missing? Thanks! Erik --

Re: How do you escape % when formatting a string?

2007-04-02 Thread irstas
On Apr 2, 10:50 pm, erikcw [EMAIL PROTECTED] wrote: Hi, I'm trying to format a string like so: string = You have a 75% chance of success with %s, don't use %s %(a, b) This gives me: TypeError: not enough arguments for format string I've tried 75\%, but that doesn't seem to help. What

Re: How do you escape % when formatting a string?

2007-04-02 Thread irstas
On Apr 2, 10:52 pm, [EMAIL PROTECTED] wrote: On Apr 2, 10:50 pm, erikcw [EMAIL PROTECTED] wrote: Hi, I'm trying to format a string like so: string = You have a 75% chance of success with %s, don't use %s %(a, b) This gives me: TypeError: not enough arguments for format string

Re: How do you escape % when formatting a string?

2007-04-02 Thread Terry Reedy
erikcw [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Hi, | | I'm trying to format a string like so: | | string = You have a 75% chance of success with %s, don't use %s %(a, | b) | | This gives me: | TypeError: not enough arguments for format string | | I've tried 75\%, but that

Re: How do you escape % when formatting a string?

2007-04-02 Thread Bill Scherer
erikcw wrote: Hi, I'm trying to format a string like so: string = You have a 75% chance of success with %s, don't use %s %(a, b) This gives me: TypeError: not enough arguments for format string I've tried 75\%, but that doesn't seem to help. What am I missing? Thanks! Erik You