I'm using python 3.5.1 and I've had this problem with a few scripts. When I have multiple input()
lines in a row, the ipython window will skip lines in between them. Here's my code:
def DMScalc(D, M, S):
if D < 0.:
DD = D + M*(-1)/60 + S*(-1)/3600
else:
DD = D + M/60 + S/3600
return DD
print("\nConvert Degrees-Minutes-Seconds to Decimal Degrees")
D = float(input("Degrees: "))
M = float(input("Minutes: "))
S = float(input("Seconds: "))
print('Decimal Degrees:', end=' ')
print(DMScalc(D, M, S))
The ipython window shows the following:
Convert Degrees-Minutes-Seconds to Decimal Degrees
Degrees: 33
Minutes: 29
Seconds: 38
Decimal Degrees: 33.49388888888889
I'd like to remove the skipped lines above Degrees, Minutes, and Seconds so the end result is this:
Convert Degrees-Minutes-Seconds to Decimal Degrees
Degrees: 33
Minutes: 29
Seconds: 38
Decimal Degrees: 33.49388888888889
I checked the documentation for input()
and it only talks about a trailing newline, which I don't think is the problem here.