Skip to content

Commit

Permalink
Changed to the f' format (RedHat-Israel#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaDinaburgVulikh committed Nov 5, 2020
1 parent 302567c commit 45d942c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
- Create a new file *my_full_name.py* using vim editor
- Get the user's first name and save it in a new variable **first_name**
- Get the user's last name and save it in a new variable **last_name**
- Print **first_name** and **last_name** using %s formatting
- Print **first_name** and **last_name** using `f'.{}.'` formatting
- Save the file and run it on the terminal
4 changes: 2 additions & 2 deletions docs/course_materials/variables_data_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ <h3><b>Formatting</b></h3>
<pre><code data-trim data-noescape class="hljs lang-python">
>>> name = 'Tom'
>>> family_name = 'Sawyer'
>>> print('Hello %s!' % name)
>>> print(f'Hello {}!')
>>> Hello Tom!
>>> print('Hello %s %s!' % (name, family_name))
>>> print(f'Hello {name} {family_name}!')
>>> Hello Tom Sawyer!
</code></pre>
</section>
Expand Down

0 comments on commit 45d942c

Please sign in to comment.