This is the continuation of series of blog post on getting started to data science using python (part 1,part 2) . So today will explore the building blocks of python with emphasis on variable strings and numbers .
Variable – simply which can occupy memory and store value and the best thing about python is you do not have to
explicitly declare type to a variable .
Simply you can consider variable as like
the pocket in your shirt just with using (=) you can assign value to a
Lets check the type of the variable using typefunction:
Here you did not have to explicitly mentioned the type.
You can also assigns same value to multiple variable simultaneously:
String is a very popular among the data types in python you can create a string by quoting the characters as like :
The easiest way to explore string is by simply
str. + tab
Will explore a few of the function in string :
String formattingoperator is one of the best features in python with of % symbol where you can structure your code accordingly as below , again you can make use of other option with % + Tab
To know more how the function would work
Converting an integer to string :
More operation on string :
Example on numbers :
Floor division //, modulus %, power **
So this are few example you can try it out on your notebook . Stay tune
Happy Learning and sharing !!