-
-
Save JeffersGlass/f5d52dc0a2d5b5b8af53c9edb27e5337 to your computer and use it in GitHub Desktop.
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
def success(*args): | |
"""Prints a statement to the console that the numbers given as arguments sum to 2020 and prints their product | |
""" | |
print("Found that ", end = "") | |
product = 1 | |
for i in range(len(args)): | |
print(f"{args[i]}", end = "") | |
if i < len(args)-1: print(" and ", end = "") | |
product *= args[i] | |
print (f" sum to 2020; their product is: {product}") | |
#Original implemenetation of this function that accepted only two arguments: | |
#print(f"Found that {first} and {second} sum to 2020; their product is {first*second}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment