[Tutor] i have a question???

Pierre Barbier de Reuille pierre.barbier at cirad.fr
Thu Feb 3 15:32:38 CET 2005



Michael Janssen a écrit :
> On Thu, 3 Feb 2005 05:53:31 -0800 (PST), alieks laouhe
> <scilamed at yahoo.com> wrote:
> 
>>This is from a tutorial
>>
>>"EXERCISE 3.9
>>Use the math library to write a program to print out
>>the sin and cos of numbers from 0 to 2pi in intervals
>>of pi/6. You will need to use the range() function."
>>
>> Range won't let me use pi/6 as an incremator
> 
> 
> correct. The range is for integers only. You _can_ do the exercise
> with the range function but it would be easier without (eg. with a
> while-loop).

I disagree ... :P And your next remark makes it clear range (or even 
better : xrange) is exactly what's needed for that problem !

> 
> Hint-no-solution: You will need a certain number of intervals, which
> (the number of intervalls) is plain integer. Then translate from
> current-intervall-number to pi'ish (sorry for that, my english ;-)
> value.
> 
> regards
> Michael

-- 
Pierre Barbier de Reuille

INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP
Botanique et Bio-informatique de l'Architecture des Plantes
TA40/PSII, Boulevard de la Lironde
34398 MONTPELLIER CEDEX 5, France

tel   : (33) 4 67 61 65 77    fax   : (33) 4 67 61 56 68


More information about the Tutor mailing list