Python Training for Power Systems Engineers
For each of the following examples write down the answer you expect to see Python output.
def is_green(generator):
'Returns True if fuel is low carbon'
return generator['fuel'].upper() in ['WIND', 'WATER', 'GEO', 'SOLAR']
is_green({'fuel': 'geo'})def is_green(generator):
'Returns True if fuel is green energy'
return generator['fuel'].upper() in ['WIND', 'WATER', 'GEO', 'SOLAR']
is_green({'fuel': 'coal'})System notices look like this:
GEN NAME at AMOUNT
write a function called system_notice that will return this system notice string when given a dictionary with keys: 'name' and 'amount'
what is the output string when given this dictionary?:
system_notice({'amount': 2000, 'name': 'Harris'})def is_coal(generator):
'Returns True if fuel is coal'
return generator['fuel'] == 'coal'
is_coal({'fuel': 'COAL'})