From 579396836f5d8290633fb5c336426368014b6507 Mon Sep 17 00:00:00 2001 From: Anna Dinaburg Vulikh <66639090+AnnaDinaburgVulikh@users.noreply.github.com> Date: Sun, 27 Dec 2020 19:21:54 +0200 Subject: [PATCH] Changed to the f' format (#377) (#396) * Changed to the f' format (#377) * Corrected f' statement --- .../exercises/03_Variables_and_datatypes/class_exercise_2.md | 2 +- docs/course_materials/variables_data_types.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/course_materials/exercises/03_Variables_and_datatypes/class_exercise_2.md b/docs/course_materials/exercises/03_Variables_and_datatypes/class_exercise_2.md index 9f792ae1..6d26198b 100644 --- a/docs/course_materials/exercises/03_Variables_and_datatypes/class_exercise_2.md +++ b/docs/course_materials/exercises/03_Variables_and_datatypes/class_exercise_2.md @@ -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 diff --git a/docs/course_materials/variables_data_types.html b/docs/course_materials/variables_data_types.html index 26de0579..e970da47 100644 --- a/docs/course_materials/variables_data_types.html +++ b/docs/course_materials/variables_data_types.html @@ -389,9 +389,9 @@
>>> name = 'Tom'
>>> family_name = 'Sawyer'
- >>> print('Hello %s!' % name)
+ >>> print(f'Hello {name}!')
>>> Hello Tom!
- >>> print('Hello %s %s!' % (name, family_name))
+ >>> print(f'Hello {name} {family_name}!')
>>> Hello Tom Sawyer!