Skip to content
Snippets Groups Projects
Commit 43fe21fb authored by Brady James Garvin's avatar Brady James Garvin
Browse files

Replaced leftover uses of .format with f-strings in the task description text.

parent 760f15f4
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -5,7 +5,7 @@
<blockquote>
<code>class Book(object):</code><br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;def __init__(self, comment):</code><br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print('Created a book with the comment {comment}'.format(comment=comment))</code>
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(f'Created a book with the comment {comment}')</code>
</blockquote>
<p>prints a line whenever a book object is created. The call to the constructor would look like this:</p>
<blockquote><code>a_book = Book('(400 pages)')</code></blockquote>
......
......@@ -5,10 +5,10 @@
it, but need additional code in case they never find what they are looking for. For example:</p>
<blockquote><code>for i in range(10):</code><br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;if i ** 3 == 500:</code><br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print('The cube root of 500 is {i}.'.format(i=i))</code><br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(f'The cube root of 500 is {i}.')</code><br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break</code><br>
<code>else:</code><br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;print('The cube root of 500 is not an integer between 0 and 9.'.format(i=i))</code>
<code>&nbsp;&nbsp;&nbsp;&nbsp;print('The cube root of 500 is not an integer between 0 and 9.')</code>
</blockquote>
<p>Fill in the placeholders so that the actual outputs match the expected outputs.</p>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment