Skip to main content

Posts

Showing posts with the label Variables and datatypes in Python with example code.

---Variables and data type in Python ---

 Variables:  Variables can be considered as the name of a container. In other words, a variable is a container whose value can change depending on certain conditions.  When we allocate a value to a variable, it is known as a variable assignment.  In python, the syntax for it is   variable_name = value  Let's understand Variables with the help of a birthday card. My birthday 1 st July 5:00 PM  12/2, Rajouri Gardens  9898463123 Now depending on whose birthday it is and who is being invited, the details being filled in the ‘_______’ (blank space) keep on changing…right?  Imagine this ‘________’ as a container and the details being filled are the values. This value can change depending on circumstances. Variables can be considered as the name of a container. So in the above example,  date=”1 st July”  address=”12/2, Rajouri Gardens”  If the card is filled by someone else it can be,  date=”21 st July”  address=”34, MG...