+ 1

Can someone help me with last 3questions for Python?1.On file handling,2.On OOP(juice maker),adding words(last topic in python3)

14th Dec 2020, 6:05 PM
James Karino Simel
James Karino Simel - avatar
9 Answers
0
Python3
14th Dec 2020, 6:06 PM
James Karino Simel
James Karino Simel - avatar
0
Can you please link your attempts here?
14th Dec 2020, 6:08 PM
Lisa
Lisa - avatar
0
Sure
14th Dec 2020, 6:09 PM
James Karino Simel
James Karino Simel - avatar
0
def concatenate(*args): for i in args: print(i,end = "-") print(concatenate("I", "love", "Python", "!"))
14th Dec 2020, 6:09 PM
James Karino Simel
James Karino Simel - avatar
0
You have 2 prints in your code: Once in the function and once below. I suggest you just concatenate the string inside your function and then return the whole string.
14th Dec 2020, 6:17 PM
Lisa
Lisa - avatar
0
Example?
14th Dec 2020, 8:06 PM
James Karino Simel
James Karino Simel - avatar
0
new_str = "" for word in word_list: new_str += word
14th Dec 2020, 8:26 PM
Lisa
Lisa - avatar
0
Can we talk on WhatsApp please
14th Dec 2020, 8:28 PM
James Karino Simel
James Karino Simel - avatar
0
+254793785558
14th Dec 2020, 8:28 PM
James Karino Simel
James Karino Simel - avatar