Code: Select all
Python
siehe unten
Code: Select all
##Define a function that takes multiple string arguments
def concatenate(*args):
#Got a problem processing the tuple elements and append delimiter - to the end of each word
#Tried using a set with its add method but it didn't work
u=len(args)#Get the length of the arguments tuple
myarray={0}#initialize a new set to length 0
for k in range(0, u):
myarray.add(args[k]+"-")#append delimiter for every tuple member
return myarray
##call concatenate with parameters and print
print(concatenate("I","Love","Python"))