Re: python

Pàgina inicial

Reply to this message
Autor: Mickael Profeta
Data:  
A: guilde
Assumpte: Re: python
Coucou

> Ce n'est pas ok :
> if form.has_key("phrase"): # La clé n'existera pas si le champ
> text = form["phrase"].value # correspondant est resté vide
>
> C'est ok : !!!!!!!!!
> if form.has_key("phrase"): # La clé n'existera pas si le champ
>     text = form["phrase"].value # correspondant est resté vide

>
> Trouvez l'erreur... ;o))


Facile ;-)
En python c'est l'indentation qui fait les blocs, or ton premier code
n'est pas indente --> ton if n'a pas de bloc.

On s'y fait vite tu verras ;-)

Bon apprentissage.

Mike