Chapter 2.0 Variables and Data Types in Python- Technology369kk

Variables and Data Types

Variables: It is just like that a container where stored a data.  We are discuss about in details in this post. so be careful every line read. 

Introduction Variable:  

In Python, variables are used to store data and manipulated in a program. Unlike some other programming languages, Java, JavaScript, etc. Python does not require explicit declaration of a variable's type, as it is a dynamically typed language.
 
So, If I want to talking about desi words >> Python ko Hum Log Ek Location/Memory Mein Rakhne ke Naam Dete hai Takki Pahchana Jaa Sake. 


About Variables: 

A variable in Python:

  • Is a name that refers to a value.
  • Acts as a container for storing data values.
  • Can store different types of data such as integers, strings, lists, etc.

Example of Variables:  


# Example of variable assignment
x = 10          # Integer
name = "Shailesh"  # String
pi = 3.14       # Float
is_active = True  # Boolean



Explanation: 

  • In this example the variable name is on the left side and value assigned to it is on the right side.
  •  

    Rules for Naming Variables

    • Must start with a letter or an underscore (_).
    • Cannot start with a number.
    • Can contain letters, numbers, and underscores.
    • Variable names are case-sensitive (age and Age are different).
    • Avoid using reserved keywords (e.g., if, else, for).

    Hope this is helpful for you. 


    Post a Comment

    0 Comments