New course! Every coder should learn Generative AI!
Try a free lessonQ&A Discussions
What next?
1 Vote
2 Answersdef manipulate_data(n):
positives,negatives=[],[]
if not isinstance(n,list):
return
else:
for i in n:
if i>=0:
positives.append(i)
if i<0
negatives.append(i)
new=[len(positives,sum(negatives)]
return new.
please the unittest is still telling me that my code failed the "only lists" allowed test.what do I do.
0 Votes
7 Answersdef manipulate_data(n):
positives,negatives=[],[]
if not isinstance(n,list):
raise ValueError
return
else:
for i in n:
if i>=0:
positives.append(i)
if i<0
negatives.append(i)
new=[len(positives,sum(negatives)]
return new.
Someone kindly assist I keep running it in unitests and I keep getting errors.
Here's the question:
0 Votes
2 AnswersHot today
CSS TRANSITION
1 Votes
Quick question in python.
1 Votes
What’s wrong with this???
0 Votes
Doubt
1 Votes
What's wrong with these codes?
1 Votes
Binary Code
1 Votes
Is it A Bug or A Feature?
0 Votes
Was there a Go course?
0 Votes