17.12.2012 Views

Programmation PYTHON - Zenk - Security - Repository

Programmation PYTHON - Zenk - Security - Repository

Programmation PYTHON - Zenk - Security - Repository

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Recherche du plus petit élément<br />

>>> min('max')<br />

'a'<br />

>>> min(1, 2, 3, 4)<br />

1<br />

>>> min('Python')<br />

'P'<br />

>>> map(ord, 'Python')<br />

[80, 121, 116, 104, 111, 110]<br />

>>> min('1', 2, 3, '4')<br />

2<br />

Voir aussi : max.<br />

oct : oct(nombre) -> représentation octale.<br />

Renvoie une représentation octale d’un entier ou d’un entier long.<br />

Utilisation de oct<br />

>>> oct(45383)<br />

'0130507'<br />

>>> oct(4538)<br />

'010672'<br />

Voir aussi : hex.<br />

open : open(nom[, mode[, buffering]]) -> objet file<br />

Alias de file.<br />

Voir aussi : file.<br />

ord : ord(caractère) -> entier<br />

Les primitives<br />

CHAPITRE 6<br />

Renvoie le rang d’un caractère. Un caractère est un objet string de longueur 1.<br />

Rang de caractères<br />

>>> map(ord, 'abcdefgh')<br />

[97, 98, 99, 100, 101, 102, 103, 104]<br />

Voir aussi : chr.<br />

173

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!