[Python] comparer 2 strings qui sont des int

Résolu
Bonjour,

Dans une liste de string j'ai un int et voudrait faire un test sur celui-ci pour le comparer a une valeur ...

Mais je ne peux pas faire int(ce_fameux_string) !

Comment puis-je m'en sortir ???

---------
Merci !!!
---------
Configuration: Windows XP
Firefox 1.5.0.11

2 réponses

  1. ... et pour "extraire" une chaîne de caractère :
    newstring = string[i:j]

    mais int(string[i:j]) n'est pas très propre
    1. C'est du "bricollage" mais ca fonctionne !

      Alors : MERCI ;-)

      ++
  2. _int = int(...)
    int(x[, base]) -> integer

    Convert a string or number to an integer, if possible. A floating point
    argument will be truncated towards zero (this does not include a string
    representation of a floating point number!) When converting a string, use
    the optional base. It is an error to supply a base when converting a
    non-string.