VARIABLES IN PYTHON
Variables, in other words, is a LABEL. We can assign anything with a label can call as a variable.
Let say we are assigning a number to a word, like that..
In the following example, we are assigning a value of 100 into a name called mangos. Here "mangos" we call as a variable.
>>> mangos = 100
>>> apple = 200
>>> total_fruits = apple + mangos
>>> total_fruits
300
Example : 2
>>> apple = 100
>>> total = apple
>>> apple
100
Example : 3
>>> apple = 150
>>> No_of_boxes = 20
>>> total_apples = apple * No_of_boxes
>>> total_apples
3000
Variables, in other words, is a LABEL. We can assign anything with a label can call as a variable.
Let say we are assigning a number to a word, like that..
In the following example, we are assigning a value of 100 into a name called mangos. Here "mangos" we call as a variable.
>>> mangos = 100
>>> apple = 200
>>> total_fruits = apple + mangos
>>> total_fruits
300
Example : 2
>>> apple = 100
>>> total = apple
>>> apple
100
Example : 3
>>> apple = 150
>>> No_of_boxes = 20
>>> total_apples = apple * No_of_boxes
>>> total_apples
3000
No comments:
Post a Comment