Have you ever forgotten a birthday of a friend relative?computers
can hold on to that information if we tell them to.computers use variables to store information? like moving boxes. Variables have content and names that tell us what’s inside. In Python, a variable can be used to store the output of a statement in the computer’s memory.
A=23
The equals sign is used to assign a value to a variable.
The name of the variable is called its identifier
FOR ex. Day = “Monday”
Now anytime we mention the day in our code. the computer will know that we're referring to the value “Monday” inside of it. Because day stored the value Monday
So when we code:- print(day)
>>>Monday
The value in double quotes like “Hello world” are strings. They can be any sequence of letters, numbers, and other symbols.
Python variable names must follow the following rules:
*********************
********************
1. They must start with a letter or an underscore


Comments
Post a Comment