Python DataType

Computer programs work with data.a datatype is a set of value,and the allowable operation on those values.the following list of python datatype.

     Numbers  

     Boolean  

     Strings  

     Tuples  

     List  

     Sets  


Numbers

In python programming language integer numbers,floating point numbers,and complex numbers,the following example count the total no of pen using number datatype.

							
box = 10;
pen_in_box = 32;
total = box * pen_in_box;
print "Total Pen",total,"In All Box";
						
							

Boolean

In python programming language,the boolean datatype is a primitive datatype having one of two values:True or False.this fundamental datatype.very common in computer programs.the following example of boolean data type in python programming.

							
a = True
b = False							
							
							

String

String a data type representing textual data in computer programs.the string is most important datatype in python programming.

String in python can be created using single quotes,double quotes,and triple quotes.when we use triple quotes,string can span sevral lines without using escape character.

							
website = "Veewom";
print(website);							
								
							
							

Tuples

A tuple is an immutable sequence datatype.the tuple can contain data types.tuple are created uisng round brackets.

The following example of tuple in python it contain more than one data into a single variables look like this example.

							
one = (1,2,3,4,5);
two = (6,7,8,9,10);

print(len(one));
print(min(one));
print(max(one));	

print(len(two));
print(min(two));
print(max(two));						
							
							

List

A list is a mutable sequence datatype.the list can contain mixed datatype.a list and a tuple share many common features.because a list is a modifiable datatype.it has some additional operations.

							
items = ["Mouse","Keyboard","LED Display"]
							
							

Sets

A set an unordered collection of data with no duplicate elements.a set supports operations like union intersection,or difference.similar as mathematics.

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!