r/learnpython • • Mar 01 '21

Python is kicking my butt

I’ve been learning python since early December now.. I seemed to become comfortable with the syntax and was gaining confidence quickly!

Then I moved on to Django and was quickly sent a reality check as the difficulty level increased really fast... I went back to python and started learning classes... this also is extremely hard to grasp..

While learning classes I realized I didn’t know for loops.. dictionaries.. len/range() nearly as much as I thought I did... the confidence I so quickly built is now gone.

I know the journey to web dev isn’t going to be easy at all.. I’m not giving up.. just wanted to get this off my chest.. I’m going back to the basics this week. Wish me luck. Have a nice week!

486 Upvotes

118 comments sorted by

View all comments

Show parent comments

5

u/tagapagtuos Mar 01 '21

If that's the case, then I would say that doing some HackerRank would help, since that's common in there.

Regardless, OP shouldn't really sweat it since range(len(...)) is usually a symptom of un-Pythonic code imo.

0

u/[deleted] Mar 01 '21

[deleted]

4

u/tagapagtuos Mar 01 '21 edited Mar 02 '21

For two objects, there's zip and itertools.zip_longest.

I would also check if I'm using the right data structure for the problem.

EDIT: zip_longest

2

u/primitive_screwhead Mar 01 '21

For two objects, there's zip

Note - zip() and zip_longest() can zip together an arbitrary amount of iterables (not just two, if that's what you were thinking).