language: Python 3 (python-3.2.3)
date: 407 days 9 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
my_string = 'voltage is E=200V and the current is I=4.5A'
 
# Assuming you are working with the hard coded index
voltage = float(my_string[13:16])
 
current = float(my_string[39:42])
 
print(voltage, current)