Skip to content

Commit bde42a9

Browse files
authored
Merge pull request #115 from lironmiz/unit8-Ex8.2.1
Create unit8_ex8.2.1.py
2 parents fbff21b + 51ae88a commit bde42a9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

unit8_ex8.2.1.py

+24
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)