added for loop for lat long input

pull/131/head
alanbjohnston 4 years ago committed by GitHub
parent 7bc4e07771
commit cb6bec4deb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,7 +28,7 @@ if (choice == '2'):
regex = '[A-Za-z]+[A-Za-z]+[0-9]+[0-9]+[A-Za-z]+[A-Za-z]' regex = '[A-Za-z]+[A-Za-z]+[0-9]+[0-9]+[A-Za-z]+[A-Za-z]'
for i in list(range(2)): for i in list(range(3)):
grid = input("\nType your 6 character character grid square (i.e. FM29ha): ") grid = input("\nType your 6 character character grid square (i.e. FM29ha): ")
@ -41,16 +41,21 @@ if (choice == '2'):
elif (choice == '3'): elif (choice == '3'):
for i in list(range(3)):
lat = input("\nType your latitude: ") lat = input("\nType your latitude: ")
try: try:
latitude = float(lat) latitude = float(lat)
print(latitude) print(latitude)
break
except ValueError: except ValueError:
print("Not a number!") print("Not a number!")
for i in list(range(3)):
long = input("\nType your longitude: ") long = input("\nType your longitude: ")
try: try:
longitude = float(long) longitude = float(long)
print(longitude) print(longitude)
break
except ValueError: except ValueError:
print("Not a number!") print("Not a number!")

Loading…
Cancel
Save

Powered by TurnKey Linux.