Can anyone tell me how to change the value of loan of a member here in my program? Like let's say I want to change Anne's loan value from 750 to 1000, how can I change only hers and keep the rest? i tried doing the readlines() method but I still cant get to change it, tried researching about it on stackoverflow too but still cant get something out of it. Any help would be appreciated!
What you can do is open the file in read mode then set a variable named contents = {filevar}.read() then make any changes to contents next do {filevar}.close() open the file in write mode then {filevar}.write(contents) {filevar}.close()
{filevar} as in the variables you opened the file as
@Codemonkey51 Ok. Thanks, I'll try it.
Your welcome sorry if it was a bit hard to understand @ZestyLad
@Codemonkey51 No worries! I get the idea anyway.
This should work pretty good, supports the same file export that you had in your original code and can support more people being added.
please upvote if this helped
@c4syner Its giving me an error with line 15 cause of integer conversion error.
@ZestyLad just make sure you're putting the literal name of the individual. Instead of putting
mark
putMark
for example.@c4syner Oh yeah, how dumb of me, its working now, thanks!