|
@@ -5,7 +5,7 @@ def example(firstargument, secondargument, thirdargument="N/A"):
|
|
""" Prints a string based on the two arguments. """
|
|
""" Prints a string based on the two arguments. """
|
|
# This is python3.6 syntax:
|
|
# This is python3.6 syntax:
|
|
# print(f"{firstargument} is the first argument.")
|
|
# print(f"{firstargument} is the first argument.")
|
|
- print("{a} is the first argument.".format(a = firstargument)) # Name the argument if you want
|
|
|
|
|
|
+ print("{a} is the first argument.".format(a=firstargument)) # Name the argument if you want
|
|
print("{} is the second argument.".format(secondargument))
|
|
print("{} is the second argument.".format(secondargument))
|
|
print("{} is the third argument.".format(thirdargument))
|
|
print("{} is the third argument.".format(thirdargument))
|
|
|
|
|
|
@@ -18,6 +18,6 @@ if __name__ == "__main__":
|
|
"""
|
|
"""
|
|
# You can just use parameters in order
|
|
# You can just use parameters in order
|
|
example("My first argument", "my second argument")
|
|
example("My first argument", "my second argument")
|
|
- # but better to use the names
|
|
|
|
- example(secondargument = "#2!", firstargument = "#1!", thirdargument = "#3!")
|
|
|
|
|
|
+ # but better to use the names, without spaces here!
|
|
|
|
+ example(secondargument="#2!", firstargument="#1!", thirdargument="#3!")
|
|
|
|
|