[Tutor] checking if a variable is an integer?

Rachel-Mikel ArceJaeger arcejaeger at gmail.com
Tue May 31 23:38:03 CEST 2011


Isn't one of the unsolved millenium prize problems one that includes the ability to find all of the prime numbers? I'm not sure if your program is possible if the input number is large.

But to check if a number x is an int, just do this:

x == int(x)


Rachel



On May 31, 2011, at 2:23 PM, Hans Barkei wrote:

> I want to make  a program that finds all the prime numbers up to a number inputed by the user.
> I want to know if it is an integer because that will tell me if it is divisible by that number or not. 
>                            ---------Hans-----
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

R.M. ArceJaeger
Author/Publisher, Platypus Press

Contact: arcejaeger at gmail.com
Website: http://rmarcejaeger.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110531/5945658a/attachment.html>


More information about the Tutor mailing list