def cuentanum(numeroin, numerofin):
cuentan = 0
sumapar = 0
cuentapar = 0
while numeroin <= numerofin:
print numeroin
numeroin = numeroin + 1
cuentan = cuentan + 1
if numeroin%2==0:
sumapar = numeroin + sumapar
cuentapar = cuentapar + 1
print 'total de numeros: ', cuentan
print 'total de la suma de numeros pares ', sumapar
print 'total de numeros pares ', cuentapar
def evaluar(numeroin, numerofin):
if numeroin<= numerofin:
cuentanum(numeroin, numerofin)
else:
print 'no puede ser mayor el numero inicial'
numeroin = int (input('Dame el numero inicial: '))
numerofin = int (input('Dame el numero final: '))
evaluar(numeroin, numerofin)
Ingenieria en Sistemas Computacionales. Instituto Tecnológico De Matamoros.
Programa - Cuenta todos los numeros en un intervalo ademas suma y cuenta los son pares
-
import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * verticies = ( (1, -1, -1), (1, 1, -1)...
-
import os import random import threading from Tkinter import * from PIL import Image, ImageTk import time import pygame ""...