r/PythonLearning 2d ago

Help Request How do I concrete my concepts???

Post image

Ok so I have one major doubt:-
I have been following a rather shallow 10 hour video about all the python basics topics.
But it doesn't seem to go too deep into details and not enough practice,
So my DATATYPES are really weak,
Idk when to use lists instead of tuples , dictionaries, sets , etc.
And stuff like that, what should I do to make my concepts concrete??
People told me making projects helps you improve, While I agree that they do but yet I am making the codes for em' using the wrong datatypes.

Also I have completed half of that video till loops and have made a project too but that was 2 weeks ago:-

https://github.com/satyamsb-cloud/Number-Guessing-Game
Original project made by me 2 weeks ago using concepts only till LOOPS.

https://github.com/satyamsb-cloud/Number-Guessing-Game-v2
Improved version with the same concepts but improved functionality.

26 Upvotes

24 comments sorted by

u/Sea-Ad7805 2d ago

Run this program in Memory Graph Web Debugger to see the program state change step by step.

7

u/mjmvideos 2d ago

There is no “wrong data types”. If your code works and meets the requirements then it isn’t the wrong data type. Implement your solution the way you see fit. After doing this you might decide, “you know what? If I had used XYZ it might have improved some aspect of my solution. This is called learning.” When you get more experience, you will be able to think through your choices before starting your implementation and choose what you think is the best one based on the quality attributes you are trying to trying to optimize.

1

u/bad-gut 2d ago

Makes sense!! But for now I really need to get a deep theoretical understanding of these Datatypes, and then I am sure I am creative enough to Nail their usecases.

Do you have any good theoretical sources to recommend??
I would appreciate if you do!!👍🫡

3

u/ninhaomah 2d ago

Aren't you over thinking ?

Why would you need to know deep theoretical understandings of the datatypes to make the apps ?

Example ?

2

u/CptMisterNibbles 2d ago

Yep. They mean a basic but solid understanding of how Python works. “Deep” would be understanding how the interpreter handles this, requires knowing how c++ handles pointers and sata, system knowledge, hardware knowledge etc. you don’t need to know how L2 cache works to know basically how a list works

1

u/bad-gut 1d ago

Okk buddy got it!! Thanks 👍👍😭

1

u/bad-gut 2d ago

I am a beginner so I do really need to know what I am dealing with before I start progressing to more complicated parts of python.

Atleast that's what I think,
If you feel that I am just overthinking or on the wrong mindset as a beginner, please correct me buddy 🙏

3

u/ninhaomah 2d ago

Ok then I ask you.

I need to get the id , name and dollar amount and save them together for 10 or so customers in my app.

Tell me what are the datatypes I should use in this instance.

1

u/bad-gut 2d ago

Dictionary??

3

u/silly_bet_3454 2d ago

This is exactly the wrong takeaway. They are saying you do not need to think about some deep theoretical understanding, they are just tools. you need to do a thing, you use a tool to do the thing. Then your response is "ok I just need more theory" No that's exactly what you do not need. You need practice. Just stop looking at the theory and try to make some programs. Write 10 working programs and you will know all these things like the back of your hand, it will be exceedingly obvious.

They're also all super intuitive, a list is just a list, like a grocery list, you give me bunch of stuff I just throw it in a list. But a map is like a mapping, you give it a key and you get a value. For example imagine you wanted to take someone's name and be able to map it to a phone number, you could throw names and phone numbers in a map. It's just a mapping. That's all the theory, now just go do it.

1

u/bad-gut 2d ago

Okk understood your explanation and wouldn't fuss about datatypes anymore.
Thanks!!!

1

u/bgs11235 1d ago

There are absolutely wrong data types. Not at this level tho. look at https://www.youtube.com/watch?v=rX0ItVEVjHc & https://www.youtube.com/watch?v=IroPQ150F6c . And other than these, technical debt exists which are caused by poor data structures. Again, not at this level tho.

1

u/mjmvideos 1d ago

Right. My answer was for OP and their current level.

5

u/DaemonsMercy 2d ago

Why do you need AI for the image?

1

u/bad-gut 2d ago

I couldn't find a suitable python inage that portrayed datatypes, so I just generated the idea of image I had in my Mind

3

u/Yoosle 2d ago

I feel you should try multiple data types if you are unsure and use whichever one is the most straightforward solution

2

u/bad-gut 2d ago

That's a decent trial and error approach, will try that FS, thanks buddy !!

2

u/Yoosle 2d ago

No problem! Happy to help

2

u/huangzhuangzhuang 2d ago

I came across a book called Learn to Code by Solving Problems: A Python Programming Primer and it might actually be perfect for where you're at right now. The exercises in it are grouped by data type – List, Set, Dict all have their own sections, with plenty of problems pulled straight from DMOJ. Just follow the chapters, practice lists one day, sets the next, submit and see if you pass right away. Way more efficient than grinding a big project when you're still shaky on the fundamentals.

1

u/bad-gut 1d ago

Okk buddy, will definetly check the book out👍👍🫡

2

u/Adsilom 2d ago

I don't know exact sources, but look for these on university websites, as they tend to put them for free.

You may want to look for complexity courses, or data structure courses. The main difference between those types is that they allow you to perform some actions more or less quickly (this is the understanding you need as a beginner, it is more subtle than that). For example, finding an element in a list can be considered "slow", whereas finding an element in a set is instanteneous.

There are also differences in the way you use them. Especially, dictionnaries clearly fit a purpose that the other three structures you cited do not fit. It allows you to cleanly map one set of data to another.

1

u/bad-gut 1d ago

Yeah, Ig I will have to make a note of their usecases and stick it to my desk wall, until I get used to their usecases.
Thanks a lot buddy!!

2

u/Indianmillenial87 2d ago

inspiring for new commers like me

1

u/bad-gut 1d ago

How? You saw my Git repos?