Retourner au contenu associé (entrée de forum : bench : pourquoi python serait lent ?)
Posté par ogotail le 03 septembre 2004 à 11:21. En réponse au message bench : pourquoi python serait lent ?. Évalué à 1.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: sources optimise
Posté par ogotail . En réponse au message bench : pourquoi python serait lent ?. Évalué à 1.
Version Python
#!/usr/bin/env python
import psyco #à commenter pour
psyco.full() # désactiver psyco
def is_premier(nombre):
for i in range(1, nombre/2): # pas besoin de chercher plus loin
if (nombre%i == 0):
return 0
return 1
if (is_premier (4012009)):
print "4012009 est premier"
else:
print "4012009 n'est pas premier"
ok je ---> []