Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,207,425 members, 7,998,990 topics. Date: Sunday, 10 November 2024 at 01:54 PM

Andela: IT Training And Job - Jobs/Vacancies (125) - Nairaland

Nairaland Forum / Nairaland / General / Jobs/Vacancies / Andela: IT Training And Job (643825 Views)

Letter To All Fresh Graduates and Job seekers / Andela: IT Training And Job - Jobs/vacancies / Similarities Between Football And Job (2) (3) (4)

(1) (2) (3) ... (122) (123) (124) (125) (126) (127) (128) ... (263) (Reply) (Go Down)

Re: Andela: IT Training And Job by rockok: 9:18am On Nov 22, 2016
Noel1:
Can someone help on this particular lab test please ?
I keep getting this error


Total Specs: 3 Total Failures: 2
1 . test_it_returns_correct_output_with_positives
Failure in line 15, in test_it_returns_correct_output_with_positives self.assertEqual(result, [4, 0], msg='Invalid output') AssertionError: Invalid output
2 . test_returns_correct_ouptut_with_negatives
Failure in line 19, in test_returns_correct_ouptut_with_negatives self.assertEqual(result, [4, -14], msg='Invalid output') AssertionError: Invalid output



Here is the my code. It works perfectly well on my machine. I don't know why i keep getting error with andela lol. Someone please help review this code:


def manipulate_data(list_arg):
pos_count = 0
neg_count = 0
positive_integers = 0
negative_integers = 0

list_result = []
if type(list_arg) != list:
return "Only lists allowed"
else:
for list_item in list_arg:
if list_item >= 0:
positive_integers += list_item
pos_count += 1
else:
negative_integers += list_item
neg_count += 1
if pos_count > 0:
list_result.append(positive_integers)
if neg_count > 0:
list_result.append(negative_integers)
return list_result



.
have you been able to solve your problem yet? I guess you have not. for most test cases in programming, it is common that there are more test cases while submitting as compared to testing your code.
One reason while you might not be able to pass the submission test might be because your code refers to 0 (zero) as a negative number. there could be zero on the list which might lead to the error you are getting.
Re: Andela: IT Training And Job by Nobody: 11:23am On Nov 22, 2016
rockok:

have you been able to solve your problem yet? I guess you have not. for most test cases in programming, it is common that there are more test cases while submitting as compared to testing your code.
One reason while you might not be able to pass the submission test might be because your code refers to 0 (zero) as a negative number. there could be zero on the list which might lead to the error you are getting.
Actually,I wasn't patient enough to interpret the question right. The first item was meant to be the number of occurence of +ve number nd not the sum. I've corrected it. Thanks bro. Are u true with the homestudy curriculum? Its a bit much.
Re: Andela: IT Training And Job by Nobody: 7:38pm On Nov 23, 2016
Hello guys, please do they accept people with only secondary school certificate? Comment please if you know someone who got in with secondary cert. Thanks.

CC erza ramos16 Blueyedgeek Toystars
Re: Andela: IT Training And Job by Nobody: 12:20am On Nov 24, 2016
Geist:
let's see the code you have written. Then we can take it from there
Hello guy, please do they accept people with only secondary school certificate? Thanks.
Re: Andela: IT Training And Job by Geist(m): 12:24am On Nov 24, 2016
SirAbdulthe1st:

Hello guy, please do they accept people with only secondary school certificate? Thanks.
yes they do
Re: Andela: IT Training And Job by Nobody: 2:03am On Nov 24, 2016
Geist:
yes they do
Thanks.
Re: Andela: IT Training And Job by worisj(m): 7:54pm On Nov 24, 2016
Noel1:
Actually,I wasn't patient enough to interpret the question right. The first item was meant to be the number of occurence of +ve number nd not the sum. I've corrected it. Thanks bro. Are u true with the homestudy curriculum? Its a bit much.
Have You Submitted It Now?
Re: Andela: IT Training And Job by Nobody: 8:11pm On Nov 24, 2016
worisj:
Have You Submitted It Now?
yes bros. Tnx. Have u submitted ?
Re: Andela: IT Training And Job by worisj(m): 9:00pm On Nov 24, 2016
Noel1:
yes bros. Tnx. Have u submitted ?
Not yet, was yours successfull?
Re: Andela: IT Training And Job by worisj(m): 9:27pm On Nov 24, 2016
Noel1:
yes bros. Tnx. Have u submitted ?
i keep getting error running your script, but its working fine on my python ide, heres my code
def manipulate_data(mylist):
if type(mylist) != list:
return "only list allowed"
else:
newlist = [x for x in mylist if x<0]
neg_no = sum(newlist)
pos_no_count = 0
for num in mylist:
if num>0:
pos_no_count = pos_no_count + 1
else:
return [pos_no_count, neg_no]
manipulate_data([1,2,3,4])
Re: Andela: IT Training And Job by worisj(m): 9:45pm On Nov 24, 2016
worisj:
Not yet, was yours successfull?
heres d code for my binary conversion, its still the same error occured
def binary_converter(num):
x = bin(num)
if num>=0 and num<=255:
return x
else:
return "Invalid input"
binary_converter(0)
binary_converter(62)
binary_converter(-1)
binary_converter(300)

Re: Andela: IT Training And Job by worisj(m): 9:47pm On Nov 24, 2016
worisj:
i keep getting error running your script, but its working fine on my python ide, heres my code
def manipulate_data(mylist):
if type(mylist) != list:
return "only list allowed"
else:
newlist = [x for x in mylist if x<0]
neg_no = sum(newlist)
pos_no_count = 0
for num in mylist:
if num>0:
pos_no_count = pos_no_count + 1
else:
return [pos_no_count, neg_no]
manipulate_data([1,2,3,4])

Re: Andela: IT Training And Job by Looben: 10:02pm On Nov 24, 2016
worisj:
heres d code for my binary conversion, its still the same error occured
def binary_converter(num):
x = bin(num)
if num>=0 and num<=255:
return x
else:
return "Invalid input"
binary_converter(0)
binary_converter(62)
binary_converter(-1)
binary_converter(300)

First, Remove lines 7-10 then try again. You are calling the function (i.e try to excute/test/run your code). Meanwhile the proctor platform will do that for you.
Re: Andela: IT Training And Job by Looben: 10:02pm On Nov 24, 2016
[quote author=worisj post=51342986][/quote]

Same here. Remove line 13.
Re: Andela: IT Training And Job by Looben: 10:05pm On Nov 24, 2016
Looben:


Same here. Remove line 13.

Good job tho. Clean and understandable codes.
Re: Andela: IT Training And Job by worisj(m): 10:16pm On Nov 24, 2016
Looben:


First, Remove lines 7-10 then try again. You are calling the function (i.e try to excute/test/run your code). Meanwhile the proctor platform will do that for you.
Ok Thanks, Ill Try Again When There Is Light
Re: Andela: IT Training And Job by worisj(m): 10:29pm On Nov 24, 2016
Looben:


Good job tho. Clean and understandable codes.
I really appreciate your comment!! smiley
Looben:


Good job tho. Clean and understandable codes.
I really appreciate your comment!!
Re: Andela: IT Training And Job by Nobody: 1:59am On Nov 25, 2016
worisj:
i keep getting error running your script, but its working fine on my python ide, heres my code
def manipulate_data(mylist):
if type(mylist) != list:
return "only list allowed"
else:
newlist = [x for x in mylist if x<0]
neg_no = sum(newlist)
pos_no_count = 0
for num in mylist:
if num>0:
pos_no_count = pos_no_count + 1
else:
return [pos_no_count, neg_no]
manipulate_data([1,2,3,4])

Am really sorry bro. I had logged out before u sent ur message:
This worked the last time I did it. [Please do not forget the indentation]


def manipulate_data(list_par):
neg_count = 0
pos_count = 0
positive_int = 0
negative_int = 0

my_result = []
if type(list_par) != list:
return "Only lists allowed"
else:
for list_item in list_par:
if list_item >= 0:
positive_int += list_item
pos_count += 1
else:
negative_int += list_item
neg_count += 1

my_result.append(pos_count)
my_result.append(negative_int)
return my_result
Re: Andela: IT Training And Job by Nobody: 2:06am On Nov 25, 2016
worisj:
heres d code for my binary conversion, its still the same error occured
def binary_converter(num):
x = bin(num)
if num>=0 and num<=255:
return x
else:
return "Invalid input"
binary_converter(0)
binary_converter(62)
binary_converter(-1)
binary_converter(300)

You don't need to call the functions by yourself. The proctor test is meant to do that. What it does is ensure that your codes meet the defined specs.

Again, you need to substring your result. See it here:

def binary_converter(num):
x = bin(num)[2:]
if num>=0 and num<=255:
return x
else:
return "Invalid input"
Re: Andela: IT Training And Job by MaZee1: 10:37am On Nov 25, 2016
Pls add 08187246453 to the group
Re: Andela: IT Training And Job by blueyedgeek(m): 9:39am On Nov 26, 2016
SirAbdulthe1st:
Hello guys, please do they accept people with only secondary school certificate? Comment please if you know someone who got in with secondary cert. Thanks.

CC erza ramos16 Blueyedgeek Toystars

That shouldn't stop you from applying. All that matters is that you have the growth mindset and the grit and persistence to follow through with it.

Side note: I got in with just my sec. school certificate.
Re: Andela: IT Training And Job by osanebipet: 10:15am On Nov 27, 2016
Please Add me to the WhatsApp group 08165025263
Re: Andela: IT Training And Job by MaZee1: 7:46pm On Nov 27, 2016
Please Add me to the WhatsApp group 08187246453
Re: Andela: IT Training And Job by D34lw4p(m): 12:16pm On Nov 28, 2016
Re: Andela: IT Training And Job by worisj(m): 1:04pm On Nov 28, 2016
Noel1:


Am really sorry bro. I had logged out before u sent ur message:
This worked the last time I did it. [Please do not forget the indentation]


def manipulate_data(list_par):
neg_count = 0
pos_count = 0
positive_int = 0
negative_int = 0

my_result = []
if type(list_par) != list:
return "Only lists allowed"
else:
for list_item in list_par:
if list_item >= 0:
positive_int += list_item
pos_count += 1
else:
negative_int += list_item
neg_count += 1

my_result.append(pos_count)
my_result.append(negative_int)
return my_result
Thanks bro i have submitted it, please take a look at my oop its returning error running script but its working on my ide
class BankAccount:
def withdrawal(self):
pass
def deposit(self):
pass
class SavingsAccount(BankAccount):
def __init__(self):
Re: Andela: IT Training And Job by Nobody: 1:40pm On Nov 28, 2016
worisj:
Thanks bro i have submitting it, please take a look at my oop its returning error running script but its working on my ide
class BankAccount:
def withdrawal(self):
pass
def deposit(self):
pass
class SavingsAccount(BankAccount):
def __init__(self):
self.balance = 500
def deposit(self, amount):
if amount < 0 :
return "Invalid deposit amount"
else:
self.balance += amount
return self.balance
def withdrawal(self, amount):
if amount > self.balance:
return "Cannot withdraw beyond the current account balance"
elif amount <0:
return "Invalid withdraw amount"
elif (self.balance-amount) <500:
return "Cannot withdraw beyond thew minimum account balance"
else:
self.balance -= amount
return self.balance
class CurrrentAccount(BankAccount):
def __init__(self):
self.balance = 0
def deposit(self, amount):
if amount< 0:
return "Invalid deposit amount"
else:
self.balance += amount
return self.balance
def withdraw(self, amount):
if amount < 0:
return "Invalid withdraw amount"
elif amount > self.balance:
return "Cannot withdraw beyond current account balance"
else:
self.balance -= amount
return self.balance


I went through your code bro. The only place where I seem to find a hitch is on line 21:
worisj:
return "Cannot withdraw beyond thew minimum account balance"
Obviously, this would give you error with assert.equal cause the string being tested for and your return string are not equal.

Please correct the string to:
return "Cannot withdraw beyond the minimum account balance"

Try it again and let me know if you still encounter any hitch.
Re: Andela: IT Training And Job by red90: 2:59pm On Nov 28, 2016
Good day guys. Just started the andela home study test and I'm stuck at Tax Lab. My code passes all test but when I run it says "An error occured while running your script"
Thanks
Re: Andela: IT Training And Job by worisj(m): 3:06pm On Nov 28, 2016
red90:
Good day guys. Just started the andela home study test and I'm stuck at Tax Lab. My code passes all test but when I run it says "An error occured while running your script"
Thanks
And Where Exactly Is The Code?
Re: Andela: IT Training And Job by red90: 3:27pm On Nov 28, 2016
worisj:
And Where Exactly Is The Code?

It works on my local machine but when I try to run it on Andela's, I get the error. Ps. It does not raise any exceptions other than that. So its kind of hard to debug
Re: Andela: IT Training And Job by Nobody: 12:45pm On Nov 29, 2016
worisj:
And Where Exactly Is The Code?
Have u submitted bro ?
Re: Andela: IT Training And Job by Nobody: 12:54pm On Nov 29, 2016
red90:


It works on my local machine but when I try to run it on Andela's, I get the error. Ps. It does not raise any exceptions other than that. So its kind of hard to debug
Can u paste the code plz ?

(1) (2) (3) ... (122) (123) (124) (125) (126) (127) (128) ... (263) (Reply)

How To Apply For Nigeria Immigration Service (NIS) Recruitment 2017 / Federal Road Safety Commission 2018 Recruitment: How To Apply / FIRS To Recruit 1,250 New Staff

Viewing this topic: 1 guest(s)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 43
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.