From 6296a5b75328e017ea685c67d95c9c255d0b3751 Mon Sep 17 00:00:00 2001 From: kjg Date: Wed, 20 May 2020 21:16:04 +0900 Subject: [PATCH] [Python #2] create ex8.py --- kjg/python-the-hard-way/e8.py | 11 +++++++++++ kjg/python.org | 3 +++ kjg/python.org~ | 19 ------------------- 3 files changed, 14 insertions(+), 19 deletions(-) create mode 100644 kjg/python-the-hard-way/e8.py delete mode 100644 kjg/python.org~ diff --git a/kjg/python-the-hard-way/e8.py b/kjg/python-the-hard-way/e8.py new file mode 100644 index 0000000..51adf35 --- /dev/null +++ b/kjg/python-the-hard-way/e8.py @@ -0,0 +1,11 @@ +formatter = "{} {} {} {}" +print(formatter.format(1, 2, 3, 4)) +print(formatter.format("one", "two", "three", "four")) +print(formatter.format(True, False, False, True)) +print(formatter.format(formatter, formatter, formatter, formatter)) +print(formatter.format( + "Try your", + "Own text here", + "Maybe a poem", + "Or a song about fear" +)) diff --git a/kjg/python.org b/kjg/python.org index 9cada1d..370d8d3 100644 --- a/kjg/python.org +++ b/kjg/python.org @@ -66,3 +66,6 @@ Its fleece was white as snow. And everywhere that Mary went. .......... Cheese Burger +*** Python #2: +**** ex8 +learn about a more complicated formatting of a string. {} diff --git a/kjg/python.org~ b/kjg/python.org~ deleted file mode 100644 index 13d37bc..0000000 --- a/kjg/python.org~ +++ /dev/null @@ -1,19 +0,0 @@ -*python - -*** Python #1: -**** ex0 -**** ex1 ->>> print("Hello World!") -... print("Hello Again") -... print("I like typing this.") -... print("This is fun.") -... print('Yay! Printing.') -... print("I'd much rather you 'not'.") -... print('I "said" do not touch this.') -Hello World! -Hello Again -I like typing this. -This is fun. -Yay! Printing. -I'd much rather you 'not'. -I "said" do not touch this.