# basic python program

## Positive or Negative number in Python

In this In this Basic Python Program, we will have a look at “How to find if a given number is positive, negative or zero” Python Program To Find Positive or Negative number in Python num = float(input(“Enter a number: “)) if num > 0:   print(“Positive number”) elif num == 0:   print(“Zero”) else:   print(“Negative number”) …

## Check If A Given Number Is Prime Number in Python

In this Basic Python Program, , we will have a look at how to write a code in python to find if a given number is prime or not. Python Program To Find If A Given Number Is Prime Number num = 4 if num > 1:   # check for factors   for i in range(2,num): …

## Basic Calculator in Python

Let’s have a look at Basic Calculator in Python Programming language to get you started with the basic functions of Python. Calculator in Python Programming Language def add(x, y):   return x + y # This function subtracts two numbers def subtract(x, y):   return x – y # This function multiplies two numbers def multiply(x, y): …

## Hello World Program in Python

In this Basic Python Program, we will have a look at How to print “Hello World” with the help of Python Programming Language. print(“Hello World”) Output: Hello World

## Factorial of a number in Python

In this Basic Python Program, we will find the factorial of a number. What is factorial of a number? In Mathematics, Factorial of a non-negative integer is multiplication of all integers smaller than or equal to n. Example: factorial of 3 will be 3*2*1, that will be 6. Python Program To Find The Factorial Of A …

## Add Two Number In Python

In this basic python program, we will add two numbers and print the sum of the two numbers. Python program to add two numbers a= 10 b= 20 # summing up the two numbers sum = a+ b # printing the sum print(“Sum of {0} and {1} is {2}” .format(a, b, sum)) Output: Sum of …