Advertisement
ProgramoBien

py

Apr 27th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. print('Desea aplicar o desglosar IVA? (a/d): ')
  2.  
  3. c = input()
  4. precio = 0.0
  5. if ((c!= 'a' and c!= 'd') or len(c)>1):
  6.     print('Te has equivocado, introduce de nuevo (a/d): ')
  7.     c = input()
  8.  
  9. print ('precio: ')
  10. precio = float(input())
  11.  
  12. siniva = precio//1.21
  13. coniva = precio*1.21
  14.  
  15. if c == 'a':
  16.     print('precio con iva: ', coniva)
  17.     print('iva: ',coniva-precio)
  18. else :
  19.     print('precio sin iva: ', siniva)
  20.     print('iva: ', precio-siniva)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement