Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9905be
commit a4527c5
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
# create a variable called formatter, which is a string made of 4 formatting characters | ||
formatter = "%r %r %r %r" | ||
|
||
# prints formatter with 4 digits | ||
print formatter % (1, 2, 3, 4) | ||
# prints formatter with 4 strings | ||
print formatter % ("one", "two", "three", "four") | ||
# prints formatter with 4 Booleans | ||
print formatter % (True, False, False, True) | ||
# prints formatter with itself, 4 times | ||
print formatter % (formatter, formatter, formatter, formatter) | ||
# prints formatter with 4 strings | ||
print formatter % ( | ||
"I had this thing.", | ||
"That you could type up right.", | ||
"But it didn't sing.", | ||
"So I said goodnight." | ||
) | ||
) | ||
|
||
# It uses both double and single quotes because one of the lines has an apostrophe in it |