[Tutor] i have a question???

Michael Janssen mi.janssen at gmail.com
Thu Feb 3 15:26:31 CET 2005


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).

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


More information about the Tutor mailing list