Ver Mensaje Individual
  #7 (permalink)  
Antiguo 03/11/2011, 15:50
Avatar de _cronos2
_cronos2
Colaborador
 
Fecha de Ingreso: junio-2010
Mensajes: 2.062
Antigüedad: 13 años, 10 meses
Puntos: 310
Respuesta: Problemas con mini programas.

A ver así:
Código Python:
Ver original
  1. # -*- coding: utf-8 -*-
  2.  
  3. ns = []
  4. strn = 'El mayor era '
  5. letras = ['a', 'b', 'c']
  6.  
  7. for i in range(0, 3):
  8.     ns.append( int( raw_input('Introduzca un número: ') ) )
  9.  
  10. maximo = max(ns)
  11. pos = ns.index(maximo)
  12. ns.pop(pos) # Borramos este elemento
  13.  
  14. strn += letras[pos]
  15. letras.pop(pos)
  16. strn += ', ' + ' y '.join(letras) + ' eran menores'
  17. print strn
Saludos (:
__________________
" Getting older’s not been on my plans
but it’s never late, it’s never late enough for me to stay. "
Cigarettes - Russian Red