We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fbff21b + 51ae88a commit bde42a9Copy full SHA for bde42a9
unit8_ex8.2.1.py
@@ -0,0 +1,24 @@
1
+# exercise 8.2.1 from unit 8
2
+'''
3
+Given the plan:
4
+
5
+data = ("self", "py", 1.543)
6
+format_string = "Hello"
7
8
+print(format_string % data)
9
+We updated the format_string variable to print:
10
11
+Hello self.py learner, you have only 1.5 units left before you master the course!
12
+Guidelines
13
+Use the data variable.
14
+Note that only one digit is printed after the period (ie the number 1.5).
15
16
17
+def main():
18
+ data = ("self", "py", 1.543)
19
+ data = ("self", "py", "1.543")
20
+ format_string = "Hello %s learner, you have only %.1f units left before you master the course!"
21
+ print(format_string % (data[0], float(data[2])))
22
23
+if __name__ == "__main__":
24
+ main()
0 commit comments