[Tutor] range function and floats?

Joel Knoll mindarson at live.com
Wed Jan 5 06:24:18 CET 2011


I'm new to Python and to programming in general.  

I'm trying to write a simple program to give the sine of each of a range of numbers, including multiples of pi.  

I keep getting a syntax error, highlighting my use of 2pi as an argument in the range, saying something like "expected integers, got float instead".  

Can I not use a float like pi in the range function?  Or what might I be doing wrong?

Also, I understand I may not be doing this in the most efficient way, but this is more about learning how the range function and floats work than
about writing a super-efficient program.  

Thanks for your time, 

Joel C Knoll


 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110105/28ba5284/attachment.html>


More information about the Tutor mailing list