Skip to content

Instantly share code, notes, and snippets.

@psicobyte
Created August 6, 2013 11:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psicobyte/6163842 to your computer and use it in GitHub Desktop.
Save psicobyte/6163842 to your computer and use it in GitHub Desktop.
Ejemplo para el Curso de Introducción a Python del Centro de Enseñanzas Virtuales de la Universidad de Granada
#!/usr/bin/python
# -*- coding: utf-8 -*-
for numero in range(2,100):
for divisor in range(2,numero):
if numero % divisor == 0:
print numero, 'es múltiplo de', divisor, 'y', numero/divisor
break
else:
print numero, 'es un número primo'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment