mirror of
https://github.com/Fechin/reference.git
synced 2026-11-21 05:24:10 +03:00
Fixes space between arguments in format() Method
This commit is contained in:
1 parent
fa88a3f093
commit
6130d8c3e6
1 file changed
+3
-3
@@ -421,9 +421,9 @@ print("%s is %d years old." % (name, age))
|
||||
|
||||
#### format() Method
|
||||
```python
|
||||
txt1 = "My name is {fname}, I'm {age}".format(fname = "John", age = 36)
|
||||
txt2 = "My name is {0}, I'm {1}".format("John",36)
|
||||
txt3 = "My name is {}, I'm {}".format("John",36)
|
||||
txt1 = "My name is {fname}, I'm {age}".format(fname="John", age=36)
|
||||
txt2 = "My name is {0}, I'm {1}".format("John", 36)
|
||||
txt3 = "My name is {}, I'm {}".format("John", 36)
|
||||
```
|
||||
|
||||
### Input
|
||||
|
||||
Reference in new issue
Block a user