Advertisement
LordCheese

Untitled

Oct 3rd, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. def getString(self):
  2. s = 'El libro ' + self.titulo + ' fue escrito por ' + self.autor + ' en el año ' + str(self.anoPublicacion) + ' y pertenece a la editorial ' + self.editorial + ' y tiene ' + self.cantPaginas + ' páginas'
  3. if ( self.titulo == "" or self.autor == "" or self.editorial == "" or self.anoPublicacion == 0 or self.cantPaginas == 0 ):
  4. if (self.titulo == ""):
  5. print ("Ingrese un titulo válido")
  6. if (self.autor == ""):
  7. print ("Ingrese un autor válido")
  8. if (self.editorial == ""):
  9. print ("Ingrese un editorial válido")
  10. if (self.anoPublicacion == 0):
  11. print ("Ingrese un año de publicación válido")
  12. if (self.cantPaginas == 0):
  13. print ("Ingrese una cantidad de páginas válidas")
  14. else:
  15. return s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement