8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e916e1 commit 85642edCopy full SHA for 85642ed
src/printing.py
@@ -12,6 +12,30 @@
12
# y, and z:
13
# x is 10, y is 2.25, z is "I like turtles!"
14
15
+print('x is %s!' % x)
16
+print('y is %s!' % y)
17
+print('z is %s' % z)
18
+
19
# Use the 'format' string method to print the same thing
20
-# Finally, print the same thing using an f-string
21
+str = "x is {}"
22
+print (str.format(x))
23
24
+str = "y is {}"
25
+print (str.format(y))
26
27
+str = "z is {}"
28
+print (str.format(z))
29
30
+# Finally, print the same thing using an f-string
31
32
+# name = "Eric"
33
+# >>> age = 74
34
+# >>> f"Hello, {name}. You are {age}."
35
+# 'Hello, Eric. You are 74.'
36
37
+print (f'x is {x}')
38
39
+print (f'y is {y}')
40
41
+print (f'z is {z}')
0 commit comments