File tree Expand file tree Collapse file tree 5 files changed +42
-1
lines changed Expand file tree Collapse file tree 5 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1+ # How to Properly Indent Python Code
2+
3+ This folder contains sample code for the Real Python tutorial [ How to Properly Indent Python Code] ( https://realpython.com/how-to-indent-in-python/ ) .
Original file line number Diff line number Diff line change 1+ long_list_of_names = [
2+ "Amy" ,
3+ "Brian" ,
4+ "Carol" ,
5+ "Dennis" ,
6+ "Emma" ,
7+ "Frank" ,
8+ "Georgia" ,
9+ "Herbert" ,
10+ "Isabelle" ,
11+ "Joshua" ,
12+ "Kimberly" ,
13+ "Laurence" ,
14+ "Megan" ,
15+ "Nicolas" ,
16+ "Ophelia" ,
17+ ]
Original file line number Diff line number Diff line change 1+ lucky_number = 7
2+ for number in range (10 ):
3+ if number == lucky_number :
4+ print ("Found the lucky number!" )
5+ else :
6+ print (f"{ number } is not my lucky number." )
7+
8+ print ("Done." )
Original file line number Diff line number Diff line change 1+ # ruff: noqa
2+ def add (a , b ):
3+ answer = a + b
4+
5+ return answer
6+
7+ def sub (c ,
8+ d ):
9+
10+ answer = c - d
11+
12+ return answer
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ line-length = 79
44exclude = [
55 " .devcontainers" ,
66 " .github" ,
7- " migrations"
7+ " migrations" ,
8+ " how-to-indent-in-python/sample_code.py"
89]
910
1011[tool .ruff .lint ]
You can’t perform that action at this time.
0 commit comments