|
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" # IndexError: tuple index out of range
"Own text here"
"Maybe a poem"
"Or a song about fear"
))
报错:
PS C:\Users\xulin09> python ex8.py
1 2 3 4
one two three four
True False False True
{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
Traceback (most recent call last):
File "ex8.py", line 8, in <module>
"Try your" # IndexError: tuple index out of range
IndexError: tuple index out of range
|
|