I need to take a 6-significant-digit number and make it a 3-significant-digit number, but the string is structures as this:
string1 = 1.00466E+15
and I need
string2 = 1.00E+15
How do I cut out the 5th, 6th, and 7th character from this string?
I need to take a 6-significant-digit number and make it a 3-significant-digit number, but the string is structures as this:
string1 = 1.00466E+15
and I need
string2 = 1.00E+15
How do I cut out the 5th, 6th, and 7th character from this string?
string2 = string1[:4] + string1[7:]
See: https://docs.python.org/3/tutorial/introduction.html#strings - specifically 'slicing'