Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 3 years have passed since last update.

Python 繰り返し処理 演習問題回答

Last updated at Posted at 2017-12-05

1) 3 2 1 Go! と出力するプログラムをfor文を使って記述してください。

sample.py
for i in [3, 2, 1]:
    print(i)
print("Go!")

2) 1 - 100までの数字の中から偶数の値を持つ値だけのListを作成してください。

sample.py
even_lists = []
for i in range(1, 101):
    if i % 2 == 0:
        even_lists.append(i)

print(even_lists)    
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?