Hello all. I am trying to learn python and have been doing a few sites on and off like codingbat, lpthw, code academy etc.. and have decided to try and make something in an attempt to put some bits together. Plus doing so has meant I have been searching for answers and have come across some quite useful things in the process.
I am trying to create a kind of small expenditure thing which takes input from a user with the date and then under this date it gets the user to put a place of spend and then the amount, it will keep looping the last two things until the user has put in all the info for that date then they can either close or return to the menu. I would like to write this to the file defined. Originally I had this to write straight to the file but then I had problems getting it to format correctly so decided maybe the best way was with lists? Not sure if this is the best way of doing it but now for each place it writes to one list, for the amount it writes to another and then I want to combine these two on one line and write this to the file. Then for it to go back to asking for another place etc..etc..
In the end once I have done this correctly I want to be able to print the items in the file so the user can see each place and the amount under the date.
I hope that makes sense, this is probably miles away from being any where near correct. I seem to have made it worse as my original way seemed to work easier by just writing to the file after each place and amount was given.
Anyway here is what I have done so far
http://pastebin.com/K9PFcTd1
Don't expect people to complete it all for me just a few pointers of what I have done correct/haven't/what I can do and what I should do to make it neater/easier.
Thanks.
I am trying to create a kind of small expenditure thing which takes input from a user with the date and then under this date it gets the user to put a place of spend and then the amount, it will keep looping the last two things until the user has put in all the info for that date then they can either close or return to the menu. I would like to write this to the file defined. Originally I had this to write straight to the file but then I had problems getting it to format correctly so decided maybe the best way was with lists? Not sure if this is the best way of doing it but now for each place it writes to one list, for the amount it writes to another and then I want to combine these two on one line and write this to the file. Then for it to go back to asking for another place etc..etc..
In the end once I have done this correctly I want to be able to print the items in the file so the user can see each place and the amount under the date.
I hope that makes sense, this is probably miles away from being any where near correct. I seem to have made it worse as my original way seemed to work easier by just writing to the file after each place and amount was given.
Anyway here is what I have done so far
http://pastebin.com/K9PFcTd1
Don't expect people to complete it all for me just a few pointers of what I have done correct/haven't/what I can do and what I should do to make it neater/easier.
Thanks.