ej3.3.py

#!/usr/bin/python # -*- coding: utf-8 -*- try: nota = float(raw_input('Introduzca puntuación: ')) #Si la nota no esta comprendida entre 0 y 1 generamos un error if nota < 0.0 and nota > 1.0: raise ValueError if nota < 0.6: calificacion = 'Insuficiente' elif nota >= 0.6 and nota < 0.7: calificacion = 'Suficiente' elif nota >= 0.7 and nota < 0.8: calificacion = 'Bien' elif nota >= 0.8 and nota < 0.9: calificacion = 'Notable' elif nota >= 0.9: calificacon = 'Sobresaliente' print calificacion except: print "Puntuación incorrecta"

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.