Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sqlite3
- def sort_fst(n):
- return n[0]
- name = input()
- fst_rule = input()
- scnd_rule = input()
- rules = f"(NOT {fst_rule}) and (NOT {scnd_rule})"
- coords = []
- conn = sqlite3.connect(name)
- cursor = conn.cursor()
- request = f"SELECT latitude, longitude FROM Island WHERE {rules}"
- for row in cursor.execute(request):
- coords.append(row)
- conn.close()
- coords.sort(key=sort_fst)
- for coord in coords:
- print(coord)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement