Showing posts with label how to print series of prime numbers. Show all posts
Showing posts with label how to print series of prime numbers. Show all posts

Monday, 16 October 2017

Series of prime numbers in python

num=int(input("Enter a number till which you want to print prime numbers : "))
for x in range(1,num) :
         if x>1 :
                for y in range(2,x) :
                        if (x%y) ==0 :
                                break
                else:
                        print(x)

Output


Python Program to find Fabonacci

fabtab={} def fabonacci(n):     fabtab[0]=0     fabtab[1]=1     for i in range(2,n+1):         fabtab[i]=fabtab[i-1]+fabtab[i-2]         ...