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
Strange narrowing conversion error from FLTK Color to Color Struct, Stroustrup's header Graph.h
0 Votes
Python Question
3 Votes
How to learn fast C?
0 Votes
Initials of name
1 Votes
Forever loop pls help
0 Votes
Css In python
0 Votes
Method Overriding in Java
0 Votes