r/learnpython • • Dec 08 '17

Here's a website with 100+ short exercises for beginners to Python

Useful for any beginners over at www.pythonsandladders.com. A good number of questions to go through, some perhaps a little challenging even for seasoned problem solvers.

The whole thing runs in the browser through Skulpt, using JavaScript to emulate Python 2.6.

Happy coding!

374 Upvotes

24 comments sorted by

29

u/Absjalon Dec 08 '17

Why would anyone trying to learn Python want to work with 2.6? I am asking because I am about to start learning and never even considered 2.6.

4

u/himynameisshamil Dec 08 '17 edited Dec 08 '17

Skulpt.org is the limitation here -- the project seems to support "Python 2.6(ish)" Maybe something worth contributing to for 3.x support?

That said, there is no discernible effect of it being 2.6 on the questions, given the simplicity of the exercises. I know 2.7.5 pretty well and (afaik) for the scope of the exercises, there is no apparent difference.

EDIT: no apparent difference between 2.6 and 2.7.5 in the context of the exercises.

28

u/pconwell pconwell Dec 08 '17

There is absolutely no reason unless you specifically need to support a project written in python 2 and there is no hope of it being ported to python 3.

22

u/ASIC_SP learnbyexample Dec 08 '17

3

u/ThoughtfullyDpressed Dec 08 '17

Perhaps a topic for discussion, but why is Codingbat not on the list? The author's added several Python sections to his site which used to be for Java only (I practiced java on there for a long time)

2

u/ASIC_SP learnbyexample Dec 09 '17

haven't updated the list for a while, will check codingbat out and add it, thanks

51

u/yardightsure Dec 08 '17

2.6

wat

13

u/r34cher Dec 08 '17 edited Dec 08 '17

That is indeed a bummer. Will give it a try anyway.

EDIT Very basic stuff in my opinion. Did not like it.

-15

u/lolwat_is_dis Dec 08 '17

This made me kek. Top win to you, sir

6

u/krimpenrik Dec 08 '17

3 days in earning python as first language. Love it so for, so cool to be building stuff so fast. Bummer this is not in python 3.

-1

u/[deleted] Dec 09 '17

Dont worry about it. Im pretty sure all their exercises could be done by a complete beginner in like 2 hours

6

u/wasteoffire Dec 08 '17

2.6 isn't ideal but I appreciate the resource and will utilize it

3

u/sekende Dec 08 '17

i love the learning there, i give 4 star from 5 star. that because the notify error isnt make me understand 100%

2

u/BRENNEJM Dec 09 '17 edited Dec 09 '17

My biggest complaint with this is that when you run your script, it doesn't tell you if you got that exercise correct or not. When I learned I was using CodingBat. It has 78 exercises and when you run it, it sends multiple inputs through and checks to make sure that it runs correctly for all of them. That way you can't just write your script for one solution and "pass" the exercise.

Not sure what version of Python it is though. I think it's simple enough stuff though that you don't really get into too many of the changes between 2.x and 3.x.

EDIT: For anyone that want's to use CodingBat, here are the solutions I was using to check my answers. CodingBat will tell you how to do it if I remember correctly, but I found this websites solutions to be cleaner.

EDIT2: Never mind, once you get far enough in it starts sending in multiple inputs and tells you if they pass.

1

u/super-subhuman Dec 09 '17

These would have been great to start out, but they really are super easy. Even so...I have a question for...anyone.

Exercise 37: The following code will print 'None'. Why?

a_list = ['a','b','c']
a_list = a_list.append('d')
print (a_list)

1

u/GiffenCoin Dec 08 '17

So... I love the concept of this website, but I want to learn (and already started studying a bit) Python 3.x

Given it's only beginners stuff, are there significant differences? Can I still use it or am I just gonna get confused and learn things that are not applicable anymore?

7

u/pconwell pconwell Dec 08 '17

Quickly glancing at it - the exercises are very basic. The only issue I really saw that you will run into is in python3 print is formatted as

print("text to print")

and python2 is formatted as

print "text to print"

As long as you add the appropriate parenthesis in python3, you should probably be okay to follow these exercises without getting too confused.

That being said, I have no idea why the author would want to use 2.6.

1

u/GiffenCoin Dec 09 '17

Thanks for the answer! I'll give it a try :)

0

u/tragluk Dec 08 '17

One of the major resources to learning Python used to be 'Python: The Hard Way' which actually advocated going back to using an older version and skipping IDEs. The idea being that you learned to walk without crutches and it made you stronger because you were focusing on the basics and not having things like 'keyword finishers' to help you along so that when you started doing it for real you could do without.

Unfortunately I've always felt that this 'Go back to the old version' thinking held back a lot of advancement into using Python 3+

I'm sure we'll see more and continue to shake our heads at the concepts for years to come.

8

u/pconwell pconwell Dec 08 '17

I'm familiar with Zed Shaw and Learn Python the Hard Way. Even with his ridiculous rhetoric, he eventually gave in and updated his book to python 3 as well.

If you get bored, you should read his criticisms of python 3 and then the rebuttals. Honestly, Shaw sounds nutty when he tried to defend python 2.

4

u/ncubez Dec 08 '17

I used a full IDE for learning (PyCharm) and I believe it helped me a lot by ensuring I was doing the right thing (autofill suggestions, for example), or warn me when I was doing the wrong thing, for example, omitting a colon, or a tab. I don't understand when others say beginners should use a simple text editor. That's bullshit.

1

u/fiddle_n Dec 09 '17

So, I think there is some nuggets of truth in what is said here.

It's true that if you use an IDE that always shows you errors automatically and always autocompletes boilerplate for you, you'll struggle when the IDE is taken away. Suddenly, when you are in an interview and you are given pen and paper to write code down on, you don't have all of that and you'll struggle as a result. My technical interviewer for my current job has interviewed probably hundreds of CS grads at this point, including some that had masters in CS but couldn't code for shit in their interview. He hypothesises that the IDE is the reason why.

It's also true that learning the fundamentals first before learning the newer features is the way to go. It's often said learning a language that's lower level than Python can help you be better at Python. That said, sticking only to Python 2 is silly in my opinion - once you learn the basics you need to learn the newer features so you know the up to date way of doing things.

1

u/tragluk Dec 10 '17

The thing about IDEs is that it's a whole OTHER program that you need to learn on top of getting a handle on programming in the first place. To that end, forgoing them also means that you haven't learned that OTHER program.

Sure you may be able to code, but in a work environment if you don't know the IDE you're again having troubles. You don't know where things are, you don't know some of the tricks to make things faster, you get frustrated when something doesn't work the way it always has because an IDE does things in a different way.

So go through Python without one until you start to have the basics, then get yourself into an IDE as soon as possible because in the real world, you Need to know both. No Enterprise Software is coded in IDLE. I'm sure there is an exception, but 99 times out of 100 wherever you go to work will be using some kind of IDE to automate part of their workflow.