Skip to content

Commit 5bd4866

Browse files
committed
Fix some formatting and language issues
1 parent 092e2aa commit 5bd4866

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

03 Flow Control/3 For loops.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ for character in original_text:
7171
elif 'a' <= character <= 'z': # we do the same for lower case letters
7272
code = ord(character) - ord('a') # subtract lower case code "a"
7373
new_code = (code + 13) % 26
74-
encrypted_text += chr (new_code + ord('a'))
74+
encrypted_text += chr(new_code + ord('a'))
7575

7676
else:
7777
# Rewrite the remaining characters unchanged
@@ -115,7 +115,7 @@ for i in range(1, 11):
115115
and to do it backwards:
116116

117117
```python
118-
for i in range (10, 0, -1):
118+
for i in range(10, 0, -1):
119119
print(i)
120120
```
121121

@@ -132,11 +132,11 @@ trap = int(input("Enter the trap value:"))
132132

133133
for i in range (1, 11):
134134
if i == trap:
135-
print ("You felt into the trap!")
135+
print("You felt into the trap!")
136136
break
137137
print(i)
138138
else:
139-
print ("You successfully avoided the trap.")
139+
print("You successfully avoided the trap.")
140140
```
141141

142142
## Loop nesting

04 More on Variables/7 String operations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ A more sophisticated method for changing the case of letters are:
7474

7575
## String formatting
7676

77-
Python allows you to construct strings using values stored in other variables. There are three ways of doing this: with a `%` operator (this is a deprecated method and not recommended), with a `format` method, and with special *format strings*. The latter method is the easiest to use, however it <u>requires Python version 3.6 or higher</u>. As there is now a newer version available, this very method will be discussed:
77+
Python allows you to construct strings using values stored in other variables. There are three ways of doing this: with a `%` operator (this is a deprecated method and not recommended), with a `format` method, and with special *format strings*. The latter method is the easiest to use, however it <u>requires Python version 3.6 or higher</u>. As this method is the newest one available, it will be discussed here:
7878

7979
*Format strings* are special text strings that are created by adding a character `f` immediately before the double or single quotation marks that open the string (no spaces between them). In such a string, the brace has a special meaning: inside it you can put any Python expression, the value of which will be inserted into the string. E.g:
8080

0 commit comments

Comments
 (0)