You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Basic/indentation.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,14 @@
2
2
3
3
4
4
### Basic of Indentation
5
-
After completion of data type and variable I hope you understand it now I am going to here to present
6
-
**indentation** concepts which play a vital role in python app development
5
+
**indentation** concepts which play a vital role in python app development
7
6
8
7
- One of the most distinctive features of Python is its use of indentation to mark blocks of code.
9
8
- Other some languages such as c and c++ uses curly braces(**{}**) to differentiate block of code
10
-
- But in python we use indentation to differentiate block of code (basically tab of some active space)
11
-
- we use colon as starting of code block and after words all code block will placed.
9
+
- But in python, we use indentation to differentiate block of code (basically tab of some active space)
10
+
- we use a colon as the starting of code block and afterwords all code block will be placed.
12
11
- Leading whitespace (spaces and tabs) at the beginning of a logical line is used to compute the indentation level of the line, which in turn is used to determine the grouping of statements.
13
-
- A code block (body of a function, loop etc.) starts with indentation and ends with the first unindented line.
12
+
- A code block (body of a function, loop, etc.) starts with indentation and ends with the first unindented line.
14
13
- The amount of indentation is up to you, but it must be consistent throughout that block.
15
14
16
15
### For example:
@@ -36,9 +35,8 @@ if conditions:
36
35
```
37
36
38
37
### How can we write code block in one line
39
-
- Indentation can be ignored in line continuation.
40
-
- But it's a good idea to always indent. It makes the code more readable :bookmark_tabs:.
41
-
38
+
- Indentation can be ignored in line with continuation.
39
+
- But it's a good idea to always indent. It makes the code more readable.
42
40
Example:
43
41
with Brackets
44
42
```python
@@ -47,10 +45,10 @@ if(conditions) :#main code
47
45
48
46
Without Brackets
49
47
```python
50
-
if conditions :#Write Your Main Code Here
48
+
if conditions: #Write Your Main Code Here
51
49
```
52
50
53
-
### If you give wrong :hotsprings: indentation which error will occured
51
+
### If you give the wrong indentation which error will occurred
0 commit comments