On 21 Dec 2005 15:57:35 +0100, Ove Svensson <[EMAIL PROTECTED]> wrote:
>Ove Svensson <[EMAIL PROTECTED]> writes:
>
>> "P. Schmidt-Volkmar" <[EMAIL PROTECTED]> writes:
>>
>> > Hi there,
>> >
>> > I have a string in which I want to calculate how often the character ';'
>> > occurs. If the charac
Ove Svensson <[EMAIL PROTECTED]> writes:
> "P. Schmidt-Volkmar" <[EMAIL PROTECTED]> writes:
>
> > Hi there,
> >
> > I have a string in which I want to calculate how often the character ';'
> > occurs. If the character does not occur 42 times, the ";" should be added
> > so
> > the 42 are rea
"P. Schmidt-Volkmar" <[EMAIL PROTECTED]> writes:
> Hi there,
>
> I have a string in which I want to calculate how often the character ';'
> occurs. If the character does not occur 42 times, the ";" should be added so
> the 42 are reached.
>
> My solution is slow and wrong:
> for Position
P. Schmidt-Volkmar wrote:
> Hi there,
>
> I have a string in which I want to calculate how often the character ';'
> occurs. If the character does not occur 42 times, the ";" should be added so
> the 42 are reached.
>
> My solution is slow and wrong:
>
> How can this be achieved easily?
Is t
Il 2005-12-21, P. Schmidt-Volkmar <[EMAIL PROTECTED]> ha scritto:
> Hi there,
>
> I have a string in which I want to calculate how often the character ';'
> occurs. If the character does not occur 42 times, the ";" should be added so
> the 42 are reached.
>
> My solution is slow and wrong:
>
should = 42
has = Zeile.count(';')
if has < should:
Zeile += ";"*(should - has)
cheers, claude
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 2005-12-21 at 09:03, P. Schmidt-Volkmar wrote:
> Hi there,
>
> I have a string in which I want to calculate how often the character ';'
> occurs. If the character does not occur 42 times, the ";" should be added so
> the 42 are reached.
>
> My solution is slow and wrong:
> for Posi
Hi there,
I have a string in which I want to calculate how often the character ';'
occurs. If the character does not occur 42 times, the ";" should be added so
the 42 are reached.
My solution is slow and wrong:
for Position in range (0, len(Zeile)):
if Zeile[Position]==';': AnzahlS