Posts

Showing posts from April, 2018

Python Program

Python Program to Find the Number is Prime or Not Prime Number or Not : Python program to check the number is prime or not. If the number is divisible by 1 or itself then it is prime number else it is not a prime number. Program: a=[21,45,32,23,43,55] for j in range(0,6):     k=0     for i in range(2,a[j]//2+1):         if(a[j]%i==0):             k=k+1     if(k==0):         print(a[j]," is prime")     else:         print(a[j]," isn't prime") Output: 21  isn't prime 45  isn't prime 32  isn't prime 23  is prime 43  is prime 55  isn't prime

Python Data types

Image
Python Data Type  Data Types:  Data type is a classification of data that define the type of data or value that an object and variable can hold in computer programming during compiling. Python has build in data types such has list, dictionary and list in which object can be modulated after it is created but in numbers, strings and tuples object cannot be replaced. Difference between the Data Types in Python: