thanks everyone, though it was very tough, but i thank GOD
On Mon, Dec 28, 2015 at 11:29 PM, Cameron Simpson wrote:
> On 28Dec2015 01:34, Prince Udoka wrote:
>
>> bu i have come up with a solution, that will work but encounter a problem
>> in the set, giving set not man
def manipulate_data(kind, data):
if kind == 'list':
return list(data)[::-1]
elif kind == 'set':
return set(data)
elif kind == 'dictionary':
return dict.keys(data)
manipulate_data("list", range(1,6))
manipulate_data("set", {"a", "b", "c", "d", "e",})
manipu
bu i have come up with a solution, that will work but encounter a problem in
the set, giving set not manipulated correctly:
def manipulate_data(kind, data):
if kind == 'list':
return list(data)[::-1]
elif kind == 'set':
return set(data)
elif kind == 'dictionary':
wow thats true the code did not work
--
https://mail.python.org/mailman/listinfo/python-list
thanks mr cameron simpson, finally at i got the solution, God bless you:
def manipulate_data(kind, data):
if kind == 'list':
for data in [1, 2, 3, 4, 5]:
return data.reverse()
elif kind == 'set':
for data in {"a", "b", "c", "d", "e"}:
data.add("ANDELA
sir does this make sense:
def manipulate_data(item, fruits):
if item == ["apples", "oranges", "mangoes", "grapes"]:
for fruits in reversed(item):
return item
elif item == {"apples", "oranges", "mangoes", "grapes"}:
for fruits in item:
fruits.append("A
gud day sir, please i have an assignment, nd i am just 2weeks in python; i
tried the code i uploaded but its nt working plz help, i need guidiance
--
https://mail.python.org/mailman/listinfo/python-list
Create a function manipulate_data that does the following
Accepts as the first parameter a string specifying the data structure to be
used "list", "set" or "dictionary"
Accepts as the second parameter the data to be manipulated based on the data
structure specified e.g [1, 4, 9, 16, 25] for a lis