Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,193,087 members, 7,949,750 topics. Date: Sunday, 15 September 2024 at 06:06 PM |
Nairaland Forum / Nairaland / General / Jobs/Vacancies / Andela: IT Training And Job (636463 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) ... (79) (80) (81) (82) (83) (84) (85) ... (263) (Reply) (Go Down)
Re: Andela: IT Training And Job by cheks100: 4:37pm On Jan 02, 2016 |
miketayo: else: what happens? |
Re: Andela: IT Training And Job by miketayo(m): 4:45pm On Jan 02, 2016 |
Re: Andela: IT Training And Job by cheks100: 5:24pm On Jan 02, 2016 |
miketayo: If that worked, then congrats.! I would have suggested you return the balance. |
Re: Andela: IT Training And Job by miketayo(m): 5:25pm On Jan 02, 2016 |
cheks100: It didn't work |
Re: Andela: IT Training And Job by cheks100: 5:28pm On Jan 02, 2016 |
miketayo: Then return the balance. |
Re: Andela: IT Training And Job by miketayo(m): 5:38pm On Jan 02, 2016 |
cheks100: def withdraw(self, amount): if self.balance < amount: return 'Invalid transaction' else: self.balance -= amount return self.balance still didnt work |
Re: Andela: IT Training And Job by cheks100: 5:51pm On Jan 02, 2016 |
miketayo: Yes, it won't work, I just checked your code again and you have "Invalid transaction" instead of "invalid transaction". i is in lowercase not uppercase. If you do this i think your withdraw function would be ok, that is no more "Failure in line 23, in test_invalid_operation self.assertEqual(self.my_account.withdraw(1000), "invalid transaction", msg='Invalid transaction') AssertionError: Invalid transaction". 3 Likes |
Re: Andela: IT Training And Job by miketayo(m): 5:57pm On Jan 02, 2016 |
cheks100:Ur d best tanks alot worked.. Python is really different m use to Java and c++ things in quotes r like comments. Tanks alot |
Re: Andela: IT Training And Job by cheks100: 6:12pm On Jan 02, 2016 |
miketayo: Enjoy! 1 Like |
Re: Andela: IT Training And Job by forjamb(m): 8:41pm On Jan 02, 2016 |
faith2ogesco: Bro, please explain how you wrote your code, 'cause upon investigation, I detected an error in the test code andela wrote on their page. |
Re: Andela: IT Training And Job by forjamb(m): 8:42pm On Jan 02, 2016 |
Someone please add me to the whatsapp group: 08074621118, thanks. 1 Like |
Re: Andela: IT Training And Job by forjamb(m): 8:44pm On Jan 02, 2016 |
miketayo: Hi, have you been able to resolve the ds lab error. If yes, please tell me how you did it. Thanks. |
Re: Andela: IT Training And Job by forjamb(m): 8:47pm On Jan 02, 2016 |
cheks100: Hi, could you please elaborate how you merged all three under one function? I'm kind of stuck here. Thanks. |
Re: Andela: IT Training And Job by Ramos16(m): 9:44pm On Jan 02, 2016 |
miketayo: That seems to be the unit test failing, are you writing unit test? if yes, you might want to take a look at it, but if you are not writing unit test it means that the application test is breaking, maybe a bug or the way your script is structured. |
Re: Andela: IT Training And Job by miketayo(m): 10:09pm On Jan 02, 2016 |
forjamb: Yeah I was getting 1 error, I spelt my invalid transaction wrongly. That was all |
Re: Andela: IT Training And Job by miketayo(m): 10:11pm On Jan 02, 2016 |
Ramos16: Solved it .. Tanks |
Re: Andela: IT Training And Job by forjamb(m): 10:37pm On Jan 02, 2016 |
miketayo:Hi! Thanks for the response. But I wasn't referring to the OOP lab. Was actually talking about the ds lab. I think there's something wrong with the test code written by andela. I compared that of ds lab with the one written for the OOP lab and I discovered that there was something missing there. In the OOP lab's code, they used "unittest.Testcase" but in that of DS they only used "Testcase". Based on my little knowledge, the used a universal import but forgot to include the "unittest". I might be wrong though, so I stand corrected. |
Re: Andela: IT Training And Job by miketayo(m): 5:36am On Jan 03, 2016 |
forjamb: Wat errors r u getting? |
Re: Andela: IT Training And Job by rockok: 8:28am On Jan 03, 2016 |
forjamb:Maybe you did't understand the question. your function should be able to return different Ds base on the input. And that is possible using conditions in python. I hope you understand what I am trying to say here. Just use three different conditions. 1 Like |
Re: Andela: IT Training And Job by forjamb(m): 8:37am On Jan 03, 2016 |
rockok:Thanks. But I tried all three options provided in the test but still got the same error for either trials. Initially, I thought my code was incorrect as well, but I tried them out on codecademy and the codes worked. I also copied their tests code and tried them out on codecademy only to get the same error as the one I got on the test page (invalid syntax). However, I added the "unittest" omitted in their code and it worked. I'm really confused right now 'cause I've tried my code on several online python consoles and they've been correct on all of them. I also tried submitting without testing, but got the same error. Someone should please help out. |
Re: Andela: IT Training And Job by forjamb(m): 8:41am On Jan 03, 2016 |
miketayo:Here's a snapshot of the error below.
|
Re: Andela: IT Training And Job by miketayo(m): 9:42am On Jan 03, 2016 |
forjamb: these r syntax errors, like that list shouldn't be in quotes "list" am sure there r more .. syntax errors r definitely the programmers fault.. chk ur code again |
Re: Andela: IT Training And Job by jacob05(m): 10:44am On Jan 03, 2016 |
forjamb: From the error message.. The manipulate_data function is declared with a string arg "list" instead of a valid variable name list. |
Re: Andela: IT Training And Job by forjamb(m): 12:22pm On Jan 03, 2016 |
miketayo: jacob05: I was only following the instructions given. I also tried without the quotes but still nothing. |
Re: Andela: IT Training And Job by forjamb(m): 2:47pm On Jan 03, 2016 |
I'm at my wits end here. I've tried every trick in the book. Someone please help out. |
Re: Andela: IT Training And Job by cheks100: 2:48pm On Jan 03, 2016 |
forjamb: You can merge all three by using the if and elif. If the data structure is list do this, if it is a set do that etc, according to the instructions given. |
Re: Andela: IT Training And Job by cheks100: 3:34pm On Jan 03, 2016 |
forjamb: 1. Calm down. 2. Post the new error code when you are done removing the quotation marks from "list" 3. Remember that you can't use the word "list" (without the quotes) as a placeholder in ur code. Use something else. |
Re: Andela: IT Training And Job by rockok: 7:48am On Jan 04, 2016 |
In the algo lab, 1 (one) was referred to as a prime number. which is not true. one is a composite number since prime numbers should have only two factors. I had a lot of issue with that in the course of coding until i realise they meant one to be a prime number. 1 Like |
Re: Andela: IT Training And Job by Nobody: 8:01am On Jan 04, 2016 |
rockok: How did you return a set to print in {} instead of set([])? |
Re: Andela: IT Training And Job by mayoadegbola(m): 9:56am On Jan 04, 2016 |
stereo: Why do you want to do that? |
Re: Andela: IT Training And Job by 5staG(m): 10:01am On Jan 04, 2016 |
forjamb: Bro it's basically like this: def manipulate_data(data_structure, data): If type(data) == type(''): #manipulate data here elif type(data) == type({()}): #manipulate data here elif type(data) == type({}): #manipulate data here I had problems with this same section too but this was how I finaly solved it. It should work for you too. Goodluck.. 1 Like |
Re: Andela: IT Training And Job by Nobody: 11:11am On Jan 04, 2016 |
mayoadegbola: Because my output is: set(['a', 'c', 'b', 'e', 'd', 'AFRICA', 'TIA', 'ANDELA']) after using add() to attach the last three strings and expected output is: {'a', 'c', 'b', 'e', 'd', 'ANDELA', 'TIA', 'AFRICA'} So here lies the problem. Any help? 1 Like |
(1) (2) (3) ... (79) (80) (81) (82) (83) (84) (85) ... (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
(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. 44 |