r/learnpython • u/eycdicdb • 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!
6
u/[deleted] Mar 01 '21
I don't really get what you think there is to know about
lenandrange(which are two separate functions that don't really relate to each other except coincidentally.)lenis especially simple - it returns the number of values contained in a collection. Easy!rangeis a little subtle and its documentation is wrapped up withtupleandlistso it's not especially clear:https://docs.python.org/3/library/stdtypes.html#typesseq
but the long and the short of it is that it's an iterator over sequences of integers, and the most common and easiest to understand way to specify a sequence of integers is as a sequence between 0 and some other value. (For various good but tedious reasons, the interval is specified as half-open, and thus includes zero but not the end term.)