print str[0:len(str)/2]
midChar is the actual midde character of the string, and therefore is of type character. It is not the index of the middle character, which would be an integer, which is required by the bracket notation for indexing into strings.

Flask is a microframework for Python based on Werkzeug and Jinja 2. This requires you to have a good understanding of Python 2.7.
Lets install Flask!
To install Flask you can use a python repository for libraries tool called pip. Download this f…

Learn the basics of if, else, and elif statements in Python 2.7.
Use "if" statements to test a specified condition.:
The structure of an if statement is as follows:
(CODE)
Use "else" statements to allow the execution of an alternative, if the …

Learn the basics of modules and packages in Python.
Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…