From the Beginning

Notes on my Learning Code

2021-01-29から1日間の記事一覧

ループ、モジュール、ファイル

www.nikkeibp.co.jp ループ a = [1, 2, 3] while True: n = input('guess a number') if n == 'q': break try: n = int(n) #数字でなければエラーとなる。ここの書き方。 except ValueError: print('type a number or type "q" to quit.') if n in a: print(…