From 774eb84d685e17b4a3109a183915fd1845483dfa Mon Sep 17 00:00:00 2001 From: Aria Hendrawan Date: Sat, 28 Apr 2018 16:17:47 +0700 Subject: [PATCH] Menambah file 2.py 1. Go through this program and write a comment above each line explaining it. 2. Find all the places where a string is put inside a string. There are four places. 3. Are you sure there are only four places? How do you know? Maybe I like lying. 4. Explain why adding the two strings w and e with + makes a longer string. --- 2.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 2.py diff --git a/2.py b/2.py new file mode 100644 index 0000000..b850e43 --- /dev/null +++ b/2.py @@ -0,0 +1,22 @@ +types_of_people = 10 +x = f"There are {types_of_people} types of people." + +binary = "binary" +do_not = "don't" +y = f"Those who know {binary} and those who {do_not}." + +print(x) +print(y) + +print(f"I said: {x}") +print(f"I also said: '{y}'") + +hilarious = False +joke_evaluation = "Isn't that joke so funny?! {}" + +print(joke_evaluation.format(hilarious)) + +w = "This is the left side of..." +e = "a string with a right side." + +print(w + e)