From b2b442252f6efd782383ffba4ad9e5c68d57a1ba Mon Sep 17 00:00:00 2001 From: Jay Dave Date: Sat, 20 Oct 2018 00:41:25 +0530 Subject: [PATCH] Added .format() function with print --- challenges/1.1.Print/lesson.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/challenges/1.1.Print/lesson.md b/challenges/1.1.Print/lesson.md index 08f62bf..7b72c56 100644 --- a/challenges/1.1.Print/lesson.md +++ b/challenges/1.1.Print/lesson.md @@ -32,3 +32,15 @@ file=’’ ``` **_Instructions:_** **Put your name and sname to appropriate places, change '*' to parameters of separator '_' and in the end of the line '!'.** +The print() function can be used with str.format() function +``` +>>> print(“Hello World to {}".format("Geek")) +Hello World to Geek +>>> print(“{} Hello World to {}".format("Hello","Geek")) +Hello World to Geek +>>>a=2 +>>> print(“{} is the value of a".format(a)) +2 is value of a +``` +**_Instructions:_** +**put your own name instead of geek and change the value of the variable to something else**