計算機科学のブログ

ほしい物リスト

Python - SQLite - List Comprehensions: Database Integrations - for loop, string, startswith method

Head First Python: A Learner’s Guide to the Fundamentals of Python Programming, A Brain-Friendly GuidePaul Barry(著)、 O’Reilly Mediaの Chapter 13.(List Comprehensions: Database Integrations)、EXERCISE(583/682)の解答を求めてみる。

Jupyter(コード、入出力結果)

TryQueries.ipynb

import queries

statements = []
for query in dir(queries):
    if not query.startswith('__'):
        statements.append(query)
statements
['SQL_CHART_DATA_BY_SWIMMER_EVENT_SESSION',
 'SQL_SESSION',
 'SQL_SWIMMERS_BY_SESSION',
 'SQL_SWIMMERS_EVENTS_BY_SESSION']