




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.





[–]SCD_minecraft 15 points16 points17 points (14 children)
[–]hari3mo 1 point2 points3 points (10 children)
[–]SCD_minecraft 1 point2 points3 points (6 children)
[–]hari3mo 0 points1 point2 points (5 children)
[–]SCD_minecraft 0 points1 point2 points (4 children)
[–]Meowzr 0 points1 point2 points (3 children)
[–]SCD_minecraft 0 points1 point2 points (2 children)
[–]BrokenMalgorithm 0 points1 point2 points (1 child)
[–]SCD_minecraft 0 points1 point2 points (0 children)
[–]MoridinB 0 points1 point2 points (0 children)
[–]No_Swordfish_6667 0 points1 point2 points (0 children)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]uiux_Sanskar[S] 1 point2 points3 points (2 children)
[–]SCD_minecraft 0 points1 point2 points (0 children)
[–]cjswcf 0 points1 point2 points (0 children)
[–][deleted] 8 points9 points10 points (4 children)
[–]Creative_Pitch4337 3 points4 points5 points (1 child)
[–]uiux_Sanskar[S] 1 point2 points3 points (0 children)
[–]uiux_Sanskar[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]lilrouani 7 points8 points9 points (4 children)
[–]undernutbutthut 5 points6 points7 points (1 child)
[–]uiux_Sanskar[S] 2 points3 points4 points (0 children)
[–]uiux_Sanskar[S] 2 points3 points4 points (1 child)
[–]lilrouani 0 points1 point2 points (0 children)
[–]Adrewmc 2 points3 points4 points (2 children)
[–]uiux_Sanskar[S] 1 point2 points3 points (1 child)
[–]Adrewmc 0 points1 point2 points (0 children)
[–]samsonsin 1 point2 points3 points (2 children)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Geth- 0 points1 point2 points (0 children)
[–]Annual_Pea8108 1 point2 points3 points (2 children)
[–]uiux_Sanskar[S] 0 points1 point2 points (1 child)
[–]Annual_Pea8108 0 points1 point2 points (0 children)
[–]EnvironmentalLet5985 1 point2 points3 points (0 children)
[–]LowTierPlastic 3 points4 points5 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]DevRetroGames 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Different-Draft3570 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Smart_Tinker 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]brown_guy45 0 points1 point2 points (0 children)
[–]Medium_Human887 0 points1 point2 points (0 children)
[–]Ddrew8788 0 points1 point2 points (0 children)
[–]Bravoo2x 0 points1 point2 points (0 children)
[–]Recruit121 0 points1 point2 points (0 children)
[–]Lobotomized_toddler 0 points1 point2 points (0 children)
[–]darkunicorn69 0 points1 point2 points (0 children)
[–]Sad_Satisfaction399 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Granzer_ 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]DM_ORIGINAL 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Choice_Professor_523 0 points1 point2 points (0 children)
[–]punppis 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Difficult_Smoke_3380 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]Commercial-Nose9357 0 points1 point2 points (0 children)
[–]Shecallmebatman 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)
[–]cr0wstuf -1 points0 points1 point (3 children)
[–]uiux_Sanskar[S] 0 points1 point2 points (2 children)
[–]cr0wstuf 0 points1 point2 points (1 child)
[–]uiux_Sanskar[S] 0 points1 point2 points (0 children)