Keen Learner and Exp... • 1m
Day 12 of learning python as a beginner. Topic: object oriented programming (OOP). Yesterday I shared a journal taking app and many people suggested that it would be great if I used classes. Initially I was not aware of what classes actually are and today I decided to learn just that. Also I think that I might need a little more practise in this to get it on my finger tips. A class is like a blueprint of creating objects it allows you to group data (attributes) and functions (methods) together under one structure. It is just like some sort of empty template. The __init__ or initialize contains a set of default vales which can be modified later in the program. The self here refers to the current object. using this knowledge I tried to create a basic banking app where you can check your balance (not real of course), deposit money, withdraw money and get account info. In class I created account_info function which I will be using to check the account info. then I used dictionary as a database. and created a user_identity function to match that the name is actually present in the database i.e. the dictionary. Then I used my if elif and else table to match all the situations and to give the most appropriate result. I was also about to add some more function but then realised that the day is almost over and I have to give an update. 😅 Here's my code and it's result. Feel free to ask any questions and to give any suggestions and challenges which will help me improve.
Early Retiree | Fina... • 1y
The ability to work goes down once you have stopped working. Couple of classes / recordings a day was sort of usual for me. Couple of times a month it used to be 6-8 hours of live classes as well. Now if I have to do even half of that - it feels
See MoreKeen Learner and Exp... • 1m
Day 11 of learning python as a beginner. Topic: creating journal entry program using file I/O. I got a little sidleline from my original plan of editing my to-do list program and created an entirely new program this time for writing a daily journal
See MoreDownload the medial app to read full posts, comements and news.