fork download
  1. my_string = 'voltage is E=200V and the current is I=4.5A'
  2.  
  3. # Assuming you are working with the hard coded index
  4. voltage = float(my_string[13:16])
  5.  
  6. current = float(my_string[39:42])
  7.  
  8. print(voltage, current)
Success #stdin #stdout 0.02s 5852KB
stdin
Standard input is empty
stdout
200.0 4.5