calculate the% of ampoule saves, its previous consumption and the new consumption - Python

0

You must tell me how many ampules of so many watts I need.

Your test cases are:

import sys
Ampolletas = int (raw_input("Ingrese el numero de ampolletas: "))
Watts = int (raw_input("Ingrese el consumo de la ampolleta en watts: "))
Multi= Ampolletas * Watts
num = 0
num2=0
num3=0
if Ampolletas <=0 or Watts <=0:
  print"Error"
  sys.exit() 
if Multi % 150 == 0:
  num += 1
  print "n150 = %d" %num
    if Multi % 100 == 0:
       num2 +=1
       print "n100 = %d" %num2
       if Multi % 60 == 0:
          num3 += 1
          print "n60 = %d" %num3

       else:
         print"n60 = 0"
    else:
      print "n100 = 0"
else:
  print "n150 = 0"       

and I do not know how to put it to give me the results. I also do not know how to take the previous consumption, the current and how much you save, the data they give me are:

You can consider that an average month consists of 30 days and that the lights of the house are kept on between 18.00 and 24.00, because the inhabitants of the house fall asleep before midnight and when they wake up it is already daylight.  Thus, those that save least are type A with 60% savings, then come those type B that save up to 70%, those of type C that save up to 80% and others, but that are not worth considering because they are expensive and do not save so much.

On the other hand, he has discovered that the illumination of ampules of type A is equivalent to the old ampoules of 150 watts, in so much that the illumination of those of type B is equivalent to those of 100 watts and those of type C to those of 60 watts.

    
asked by Wolf 20.09.2018 в 04:34
source

0 answers