Q. Here is a partially completed program code that takes a list of strings and prints long string that is the concatenation of all the strings in the list, taken in order.


For example, if the given list L is ["These", "are", "hello"] then the program would print "Thesearehello".

There is some code missing in this program. Your task is to supply this. (Verify your answer by running the complete code in Python)


# input list here
bigstring = " " #empty string
for i in range(len(L)):
# Fill in the blank line below
    ---------------------
print (bigString)

Answer :-

Program :-
L = eval (input ("Enter the list of String :- "))
bigString = ""
for i in range(len(L)):
    bigString += L[i]
print (bigString)
Output :-

Enter the list of String :- ["These", "are", "hello"]
Thesearehello
>>>
Enter the list of String :- ["Path", "Walla", "Portal", "Express"]
PathWallaPortalExpress
>>>

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post