Welcome to part 2 of a hilariously bad tutorial on Python 3.5! I don’t know why you are here, but let’s try this anyhow. If you missed the first one, check out Part 1 now, and follow along via this tutorial, library and language for reference. Get your favorite text editor out, because we’re done typing into the command line, time to do some actual programming! I use Sublime and Note++ depending on my mood.
Lets start crappy:
Save it as Learning1.py, or whatever your glorious brain thinks is best, and execute it:
Now let us try some more complicated programs, nothing hard yet:
Run the problem giving it various numbers to test all your cases, and you’ll see the computer is almost never wrong!
Moving on, LISTS
Lists are much like everything else in python, len(listname) will return the number of objects within it, you can concatenate them, add them, etc. You can have lists within a list. Unlike strings, you CAN modify a position within a list as seen below:
Now that we have the basics out of the way, we’ll finally get around to programming within python. Stay tuned google’s web crawlers, you’ll find more links soon!
Tip: You can hit Ctrl + B inside Sublime to execute the python script right inside the text editor console.