Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcec84af

Browse files
authored
Update format.md
Added example for format function and string
1 parent08a54cd commitcec84af

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎docs/builtin/format.md‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ Python format() built-in function
1616
</base-disclaimer-content>
1717
</base-disclaimer>
1818

19-
<!-- remove this tag to start editing this page-->
20-
<empty-section />
21-
<!-- remove this tag to start editing this page-->
19+
##Examples
20+
21+
```python
22+
name='Micheal'
23+
company='Dunder Mifflin'
24+
25+
print("My name is{0} and I work for{1}.".format(name, company))
26+
27+
# Formatting string (faster and easier)
28+
print(f"My name is{name} and I work for{company}.")
29+
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp