Introduction This is the first post in the Fun with Python series. It approaches Python not with a view to learning what a variable is or what a function is but rather assumes that you have some background in these things from JavaScript, Java, C, etc. and simply want to do fun stuff with Python without trailing through all this detail all over again. User input The aim of this post is to show how we take and use input from the user. The example is hacked together at speed with web searches and educated guesswork while keeping an eye on the documentation . It is tested in version 2.7.5 on the Mac OS X. The following code does a few things: creates a file that can be run from Terminal using python filename.py demonstrates the use of comments prompts and accepts user input demonstrates the creation and use of a function tests equality in combination with a if/elif/else group of statements concatenates strings shows how an input string is converted to its int value adds t
Technology tips for writers, editors, designers, illustrators, programmers and publishers, and now Retro Gamers.