***I guess my main problem is that I don't really understand CGI or getting it to the webpage. Logically I guess I just haven't really caught onto that. Any tips?***
Write a function called isnotspace that takes a character as its argument. If that character is a space, it should return False. If it's not a space, it should return True.
True and False are values built into Python to represent the result of boolean expressions. So, in your function when you decide the character isn't a space, you give back a true result with this line (with no quotes around the True):
Test this function and make sure it works as it should. If you define the function and then enter this code:
print isnotspace(" ")
...the program should output:
Write another function called isnotvowel that takes a character as its argument. If that character is a vowel (A, E, I, O, U), it should return False. If it's not a vowel, it should return True. You should return False for both uppercase and lowercase vowels:
The output should be:
You will need these functions in the next part of the assignment.
Create a web page with a form that asks the user for their name. When they submit the page, they should see their name, modified in the following ways:
Their name unchanged, as they typed it on the form.
Their name in all uppercase letters. You can use the string.upper function from the string module for this.
Their name will all of the spaces removed. You can use the built-in filter function and the isnotspace function that you wrote for this.
Their name will all of the vowels removed. You can use the built-in filter function and the isnotvowel function that you wrote for this.
The filter function is used to select only the characters from a string that make a particular function true. For example, if the isnotspace function is defined as above,
>>> print filter(isnotspace, "a b cdeF")
You can experiment with an example of a working name game. You can copy HTML code from this example if you wish.