すぎゃーんメモ

2008-10-21

なんとなく唐突にPythonに触ってみた

Python

こんなカンジでいいのかな。

#!/usr/bin/python
a = [2]
for i in range(3, 10000):
    flg = True
    for j in a:
        if (i % j) == 0:
            flg = False
            break
    if (flg):
        a.append(i)

for i in a:
    print i

sugyan 2008-10-21 18:46

なんとなく唐突にPythonに触ってみた
Bookmark this entry on Hatena::Bookmark
Tweet
  • Read more
Write a comment
« ことえりの小文字 ファイル名の一括変更 »
Profile
id:sugyan id:sugyan Hatena Blog Pro

技術メモ とか

Subscribed unsubscribe Subscribe Subscribe
Search
Links
  • Twitter @sugyan
  • GitHub @sugyan
Recent Entries
  • N番目の素数を求める
  • Advent of Code 2020 完答した
  • 顔画像生成のためのデータセットを厳選する
  • ISUCON10 予選敗退した
  • StyleGAN2学習済みモデルを使って任意の画像を生成させる
Archive

Start using Hatena Blog!

sugyan is using Hatena Blog. Would you like to try it too?

Start using Hatena Blog (Free)
What is Hatena Blog?
すぎゃーんメモ すぎゃーんメモ

Powered by Hatena Blog | ブログを報告する

Star added

Quote saved.

Login to quote this blog

Failed to save quote. Please try again later.

You cannot quote because this article is private.

Subscribed unsubscribe Subscribe Subscribe