Friday, January 10, 2014

Basics part-1 | Variables & Datatypes

Hello... Friends today we are going to discuss about the Basic Concepts of the python & here i am going to discuss about variables , Objects and References .

So if i am going to discus about Them one by one So let's start

Variables : variables are nothing but a reserved memory locations to store any values. if we are going in more deep then we can say when we are creating a variable then we are defining a memory space in the memory . we can store integers, decimals or characters in these variables. we Don't require to declare a value to the variables. it declare automatically when we are assigning a value in the variable so let's we prove our statement  practically
in variables we can define the data types as : String , Numbers, Lists, Dictionaries, Tuples , & Boolean values







these all are the methods of declaring variables in the python as we can see from all these examples the we assign are stored in the memory of the system & as we call them then the memory address from that point will comes & gives us the value stored in the address places.

Data Type Conversions: some time we need to convert this ascii character staring into another type of data types . there are several build-in functions to perform the conversions from one datatypes to other datatypes . i am not explaining here all the datatypes but we are using the few we are going to use in our next tutorials .
str(x)----> convert objects x to a string representations.
repr(x)----> convert objects x to an expression string.
chr(x) -----> convert integer x to a character.
unichr(x) -----> convert integer x to a unicode character
hex(x) -------> convert integer x to a hexadecimal string.
oct(x) ------> converts an integer to an octal string.

here unichr(x) conversion & hex(x) are most Important these are used various times in our web application

No comments:

Post a Comment