TypeError: not enough arguments for format string
def formattedOutput(myString,myInt):
print('The result of the processing for %s was %d' % {myString,myInt})
#print('The result of the processing for %s was %d' % (myString, myInt))
#no return statement
formattedOutput('Bill',100)
Traceback (most recent call last):
File "test.py", line 6, in <module>
formattedOutput('Bill',100)
File "test.py", line 2, in formattedOutput
print('The result of the processing for %s was %d' % {myString,myInt})
TypeError: not enough arguments for format string
修改后:
def formattedOutput(myString,myInt):
#print('The result of the processing for %s was %d' % {myString,myInt})
print('The result of the processing for %s was %d' % **(myString, myInt)**)
#no return statement
formattedOutput('Bill',100)