Discussioni Q&A
Can anyone explain
1 Voto
2 RisposteHelp me
1 Voto
4 RisposteReturn, plz, help
5 Voti
5 RisposteWho can explain?
0 Voti
1 RispostaHow do i do that
0 Voti
6 RisposteFunction output
0 Voti
5 Rispostedef__
3 Voti
4 Rispostewhats wrong?
0 Voti
3 Rispostepython
0 Voti
1 RispostaPython programming
0 Voti
3 RisposteMistake Pls Help 🥺
-1 Voto
2 Rispostedef 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 Voti
7 Rispostehow
0 Voti
3 RisposteInvalid syntax
1 Voto
2 Rispostedef add(x, y):
return x + y
def do_twice(func, x, y):
return func(func(x, y), func(x, y))
a = 5
b = 10
print(do_twice(add, a, b))
Please explain step by step
Which is caller here?
Explain the 3rd and 4th line ?
why in 4th line we write add(add(x,y),add(x,y)) which is function of 1st line ?
how can we write function after return statement insted of (x+y+x+y )=30?
0 Voti
2 Rispostefunction problem
0 Voti
1 RispostaMissing code
0 Voti
3 Rispostedef 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 Voti
2 RisposteSimple code issue
1 Voto
1 RispostaPopolare oggi
Coding for Cybersecurity
1 Votes
Need help
1 Votes
Pointers in c#
1 Votes
Salut tout le monde
1 Votes