Répondre à : exercices sur python avec wims

Accueil Forums Programmation WIMS Programmation d’exercices OEF exercices sur python avec wims Répondre à : exercices sur python avec wims

#7365
Julien
Modérateur
Up
0
Down
::

Bonjour,

Tu prends un de mes modules où il y a du python par exemple Échantillonnage avec Python. Tu pourras analyser l’affichage \text{variable=[print,\SS:]} ou le contenu d’une variable \text{variable=[S,\SS]}.
Le code global à mettre dans un fichier oef est le code suivant :

\text{theme=(\confparm2==)?ambiance:\confparm2}
\text{prob=Calculer la somme des 5 premiers entiers}

\text{instructionf=Jouer le code et envoyer la réponse.}
\integer{ni=randint(1..10)}
\integer{nf=\ni+randint(5..10)}

\text{list=wims(makelist x for x=\ni to \nf)}
\text{code=
S = sum(range(??,??))
print(S)}

\text{DD=pari(default(format, "f.8");
vd=\ni;
va=\nf;
xx=0;
forstep(x=vd,va,1,xx=xx+x);
)}
\text{SS=pari(print(xx);)}

\text{variable=[print,\SS:]}
\text{variable=[S,\SS]}

\title{Somme}

\statement{

  • Calculer la somme de la liste suivante : [\list]
  • \instructionf

\embed{reply 1,[python,[\code]];[idtest2,theme=\theme canvas init \instruction_code,Jouer le code !]}
}

\answer{}{\variable}{type=runcode}{option=precision=100}