Back

Sanskar

Keen Learner and Exp...ย โ€ขย 2d

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.

Reply
2

More like this

Recommendations from Medial

Sanskar

Keen Learner and Exp...ย โ€ขย 1d

Day 13 of learning python as a beginner. Topic: create a meeting booking program with classes. Yesterday I shared my banking program and many amazing people pointed out that I didn't used classes properly and the code looks more like script. So I o

See More
Reply
2
Image Description
Image Description

Rohit Gupta

Aspiring Web Develop...ย โ€ขย 1y

Day30 of 100daysofcodechallenge... Today I learned about Object Literal, Array of object and Math object In JavaScript. I also make a basic "Guess The Number" game.

5 Replies
8

Rohit Gupta

Aspiring Web Develop...ย โ€ขย 1y

Day30 of 100daysofcodechallenge... Today I learned about Object Literal, Array of object and Math object In JavaScript. I also make a basic "Guess The Number" game.

Reply
4
Image Description
Image Description

Ravi Handa

Early Retiree | Fina...ย โ€ขย 11m

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 More
3 Replies
17

Sanskar

Keen Learner and Exp...ย โ€ขย 3d

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 More
Reply
1
10

Sidharth Bidikar

Keep Movingย โ€ขย 10m

Which function can be used to combine text from different cells into one cell without using the CONCATENATE function? A) TEXTJOIN B) CONCAT C) JOIN #excel #dataanalyst #data #dataanalysis #dataanalytics

Reply
1
6
Image Description

Prabhat Todi

Ex - Cadence Design ...ย โ€ขย 9m

About section of my whatsapp profile. To create an object for a profile, you need to create an object for the about section (this is a poor example of design for introverts). #system design

1 Reply
2
Image Description

Sanskar

Keen Learner and Exp...ย โ€ขย 6d

Day 8 of learning python as a beginner. Topic: dictionary and sets. Yesterday I posted my dynamic to-do list program and I mentioned it there that I got introduced to dictionaries. Although many people suggested me what I should learn next but I pe

See More
2 Replies
9
Image Description
Image Description

Chirotpal Das

Building an AI eco-s...ย โ€ขย 4m

I'm working towards building India's first Vector DB and Memory Management System. I'm not yet funded by any VC - bootstrapping everything with a very small team. I need the support of the community to take India's deep-tech products to the Global s

See More
8 Replies
11

Download the medial app to read full posts, comements and news.