forked from imtiazahmad007/PythonCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassignment_03.py
More file actions
48 lines (18 loc) · 682 Bytes
/
assignment_03.py
File metadata and controls
48 lines (18 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Assignment 3:
"""
Create a function called multi_merge that takes a list and a string
as arguments.
The function is supposed to return a merged list
containing the original list argument as well as each of the words that are in
the string argument in addition to each of the characters in the string
argument as individual elements in the list.
"""
# Your Code Below:
def multi_merge(list_a, str):
return list_a + str.split() + list(str)
print(multi_merge([1,2,3,4], "Hello My name is imtiaz"))
# Solution:
# def multi_merge(list_a, str):
# return list_a + str.split() + list(str)
#
# print(multi_merge([1,2,3,4], "Hello My name is imtiaz"))