Editor Archive

Python Program to Print Table – Basic Python Program

Python program to print multiplication table of a number given by user. Python Program to Print Table – Basic Python Program num=int(input("Enter a number to print it's multiplication table:")) temp=1 i=1 while i<=10: temp=num*i print(f"{num} …

Factorial

This is a python program to find the Factorial of a number. num=int(input("Enter a no to print it's factorial:")) fact=1 i=num while i>0: fact*=i i-=1 print(f"Factorial of {num} is {fact}")   Factorial of a number …

Fibonacci series

A sequence starts from 0 and 1 and every next number is a sum of previous two number ,its known as FibonacciĀ  sequence or series. n=int(input("Enter a number to print fabonacci series upto it:")) a=0 …

Print prime number

This is a python program to print all the Prime Number in an interval. print("To print all the prime numbers between a given interval") a=int(input("Enter first number:")) b=int(input("Enter second number:")) l1=a+1 while l1<b: l2=2 temp=1 …

Prime number

This is a python program to check given is a prime no or not. print("Enter a number to be check whether it is prime or not :") num=int(input()) Temp=0 i=2 while i<(num/2): if num%i==0: Temp=1 …

Leap year

Python program to check Leap year. print("Enter a year to be check whether it is leap year or not :") y=int(input()) if y%4==0: print("yes!this is a leap year") else: print("this is not a leap year") …

Odd-Even number

This is a python program to check if a given number is odd or even . n=int(input("Enter a number to be check whether it is even or odd :")) if n%2==0: print("Given number is even") …

To check if number is positive,negative or zero

print("Enter a number to be check whether it is positive ,negative or zero:") num=int(input()) if num==0: print("number is zero") elif num>0: print("number is positive") else: print("number is negative")  

Display calendar

To display calendar of a year here,we are using a calendar function and to display a particular month of a year ,we are using a month function from calendar module of python. #import the calender …

Temperature conversion

This is a python program to convert temperature from CelsiusĀ  to Fahrenheit . print("Temperature conversion") print("1.celcius to fehrenheit", "2.fehrenheit to celcius") choice=int(input("Enter your choice")) if choice==1: c=int(input("Enter temperature in celcius")) f=(9*c)/5+32 print(f"temperature in fehrenheit is …