r/PythonLearning • • 15d ago

What do you guys think?

Post image

I made a program that finds the second largest digit in a list.

Using the list method "remove()" and "max" function. Python is COOL!

88 Upvotes

58 comments sorted by

View all comments

8

u/princepii 15d ago

quick note:

that method functions if no doubles or more are in that list.

further remove() changes the list inplace. that effect is called inplace-mutation thru runtime you have removed objects inside your original list.

always try to be not restructive. only if you don't need stuff anymore thru runtime you can consider removing em.

but for 1 hour learning. it's good thought process:)

3

u/RegularBother614 15d ago

Thanks, can u recommend me sources to learn all about python? I've only watched a 1 hour python for beginners on YouTube by CodeWithMosh

4

u/princepii 15d ago

automate the boring stuff should be a good starting point. and instead of to much books or video tutorials, you can find plenty of websites where you can learn python with practice and little projects.

there are also plenty of materials other python fans created in pdf like asking questions and explaining what problem they want you to fix with finished answeres or scripts at the end.

there is no specific one i can point to.

1

u/RegularBother614 15d ago

Can u recommend something at least? It'll be really helpful

1

u/Matikus28 14d ago

I think it really depends on the person. For example, personally, I always found a video about a topic I needed for school and then tried things out by myself.Bro Code (https://www.youtube.com/@BroCodez) has pretty good videos about Python and other programming languages.Also, as a computer science student, I found it really helpful to take notes from every lecture or tutorial I watched. I had one notebook just for Python, where I wrote everything down.I don't have any experience with coding practice websites, but I think LeetCode could be a good option. There are lots of exercises with different difficulty levels, so it might be helpful. Do you want to learn Python as a hobby, or are you a student who needs it for school?