Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Ejercicio 6 - Combinados 2019
- #Autor: Diego Krauthamer
- #Declaración de variables
- cantcan=0
- tiempotot=0
- nombre=""
- duracion=-1
- continuar="S"
- #Cuerpo principal del programa
- while continuar=="S":
- #Inicializacion de variables
- nombre=""
- duracion=-1
- continuar="Z"
- #Ingreso y validacion de nombre la cancion
- while nombre=="":
- print("Ingrese nombre")
- nombre=input()
- #Mensaje de error
- if nombre=="":
- print("ERROR - Ingrese nombre correcto")
- #Ingreso y validacion de la duracion de la cantalla
- while duracion <=0:
- print("Ingrese duracion en minutos")
- duracion=int(input())
- #Mensaje de error
- if duracion <=0:
- print("ERROR - Ingrese duracion correcta")
- cantcan=cantcan+1 #Incremento contador de canciones
- tiempotot=tiempotot+duracion #Acumulo la duracion de cancion
- #Pregunto al usuario si desea continuar
- while continuar!="S" and continuar !="N":
- print("Desea continuar S/N")
- continuar=input()
- if continuar!="S" and continuar !="N":
- print("Error - ingrese S o N")
- #Salida por pantalla
- print("Cantidad de canciones:",cantcan)
- print("Tiempo Total:",tiempotot)
- print("Tiempo Total en horas:",float(tiempotot/60))
- print("Promedio:",float(tiempotot/cantcan))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement