Simple prime number generator in Python

前端 未结 26 2126
感情败类
感情败类 2020-11-22 07:16

Could someone please tell me what I\'m doing wrong with this code? It is just printing \'count\' anyway. I just want a very simple prime generator (nothing fancy).

26条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 08:02

    import time
    
    maxnum=input("You want the prime number of 1 through....")
    
    n=2
    prime=[]
    start=time.time()
    
    while n<=maxnum:
    
        d=2.0
        pr=True
        cntr=0
    
        while d

提交回复
热议问题