import sqlite3
def get_agent_price(city):
conn = sqlite3.connect('agent_prices.db')
cursor = conn.cursor()
cursor.execute("SELECT price FROM prices WHERE city=?", (city,))
result = cursor.fetchone()
conn.close()
return result[0] if result else None
# 示例:查询长春的代理价
print(get_agent_price('长春'))