数据库中有‘Rock’,但检测不到
import sqlite3
def task1_solution():
con = sqlite3.connect("Mydatabase.db")
cur = con.cursor()
cur.execute("SELECT DISTINCT Name FROM Genre;")
all_genre = cur.fetchall()
print(all_genre)
if 'Rock' in all_genre:
print("Have genre")
else:
print("No genre")
if __name__ == '__main__':
task1_solution()