Q&A Discussies
What next?
1 Stem
2 Antwoordendef 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 Stemmen
7 Antwoordendef 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 Stemmen
2 AntwoordenPopulair vandaag
Python stressed me out
1 Votes
Course Doubt
1 Votes
Data analysis
0 Votes
Help
0 Votes
How do i make a lexer and parser
1 Votes
Saved code
0 Votes