Need help on a project To :"Create a class called BankAccount with the following parameters "

Erik python at lucidity.plus.com
Fri Dec 25 19:01:32 EST 2015


Hi,

I appreciate that you've made an effort this time to write some code, 
but have you attempted to try to _execute_ any of this? [I can see that 
the answer must be "no"]

On 25/12/15 23:09, princeudo52 at gmail.com wrote:
 > #my solution is:
 > def manipulate_data(dic,dict_data = 
{'name':'prince','age':21,'sex':'male'}):
 >    return dict_data.keys()
 >
 > def manipulate_data( alist, list_data = [2,8,16,23,14]):
 >    return list_data.reverse()
 >
 > def manipulate_data(aset, set_data = {"bee","cee","dee"}):
 >    set_data = {"bee","cee","dee"}
 >    set_data.update("ANDELA","TIA","AFRICA")
 >    return dictionary_data
 > #please what is wrong with my code

If you try to execute it (by writing a test that calls the functions), 
you will get errors. Those errors will help you to fix it. If you get to 
the point where there is an error you really can't work out for yourself 
then you can ask a specific question related to what it is you don't 
understand about the error.

It looks like you're just typing in something and sending it to the list 
first rather than the Python interpreter.

If you want to learn how to program well, then you need to learn how to 
interpret the compiler/parser error messages or exceptions you get and 
work out what is wrong for yourself. You can only do that by running 
your code.

I'll give you a hint - read the words of your assignment very carefully. 
It says "a function" (not "several functions") that "Accepts as the 
first parameter a string". Look at what it then says about the second 
parameter, based on that first parameter.

Work on it from there and when you get really stuck, post the code and 
the Python error you get and why you don't understand it (saying what 
you _think_ it means but why that doesn't help you would also be good).

E.



More information about the Python-list mailing list