Skip to content

Commit 605a7b7

Browse files
authored
Update VariableAndDataTypes.md
1 parent 828a852 commit 605a7b7

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

Basic/VariableAndDataTypes.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ print(c) #3
7373

7474
Here all three variable a, b, c are assigned to the same memory location
7575

76-
### Some rules while creating variable :pencil2:
77-
76+
### Some rules while creating variable
7877
- Use variable naming convention means variable name related to real world example
7978
```python
8079
For example :person_name
@@ -86,10 +85,10 @@ Instead of: pn
8685
- Do not use reserve keyword name as variable name like list,int, str.
8786

8887

89-
### How to find out variable data type :telescope:
88+
### How to find out variable data type
9089
to find data type of already defined variable there is one default method called **type()**
9190

92-
Example :one:
91+
Example 1
9392
```python
9493
a=5
9594
print(type(a))
@@ -114,9 +113,9 @@ This will give you int result with a memory location.
114113

115114

116115

117-
### Global variable :globe_with_meridians: and local variable
116+
### Global variable and local variable
118117
- Every variable has its own scope depending upon variable declaration block
119-
#### 1. Global Variable :globe_with_meridians:
118+
#### 1. Global Variable
120119
  - Global variables are the one that are defined and declared outside a function, and we need to use them inside a function.
121120
  - If you defined a variable outside of function that can be accessible by other function so this is a global variable
122121
Example
@@ -130,7 +129,7 @@ def foo():  
130129
foo() 
131130
```
132131

133-
#### 2. Local Variable :full_moon:
132+
#### 2. Local Variable
134133
 - If a variable with same name is defined inside the scope of function as well, as it will print the value given inside the function only and not the global value.
135134
 - If a variable inside a function this is a simple example of  a local variable
136135
- This variable is accessible only by that function where it defined

0 commit comments

Comments
 (0)