[Python #2] create ex8.py
This commit is contained in:
parent
9c8e7d9045
commit
6296a5b753
3 changed files with 14 additions and 19 deletions
11
kjg/python-the-hard-way/e8.py
Normal file
11
kjg/python-the-hard-way/e8.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
formatter = "{} {} {} {}"
|
||||
print(formatter.format(1, 2, 3, 4))
|
||||
print(formatter.format("one", "two", "three", "four"))
|
||||
print(formatter.format(True, False, False, True))
|
||||
print(formatter.format(formatter, formatter, formatter, formatter))
|
||||
print(formatter.format(
|
||||
"Try your",
|
||||
"Own text here",
|
||||
"Maybe a poem",
|
||||
"Or a song about fear"
|
||||
))
|
|
@ -66,3 +66,6 @@ Its fleece was white as snow.
|
|||
And everywhere that Mary went.
|
||||
..........
|
||||
Cheese Burger
|
||||
*** Python #2:
|
||||
**** ex8
|
||||
learn about a more complicated formatting of a string. {}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
*python
|
||||
|
||||
*** Python #1:
|
||||
**** ex0
|
||||
**** ex1
|
||||
>>> print("Hello World!")
|
||||
... print("Hello Again")
|
||||
... print("I like typing this.")
|
||||
... print("This is fun.")
|
||||
... print('Yay! Printing.')
|
||||
... print("I'd much rather you 'not'.")
|
||||
... print('I "said" do not touch this.')
|
||||
Hello World!
|
||||
Hello Again
|
||||
I like typing this.
|
||||
This is fun.
|
||||
Yay! Printing.
|
||||
I'd much rather you 'not'.
|
||||
I "said" do not touch this.
|
Loading…
Reference in a new issue