everblut

Numeros Primos

Mar 8th, 2011
3,758
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. #! usr/bin/python
  2. #numeros primos
  3.  
  4. num = int(raw_input("Inserta el numero que quieras comprobar si es primo "))
  5.  
  6. for i in range(2, num):
  7.     if num % i == 0;
  8.         print num, 'No es primo'
  9.         break
  10.     else:
  11.     print num, 'es primo'
  12.     break
Advertisement
Add Comment
Please, Sign In to add comment