Start with Python

This commit is contained in:
Kenneth Mendonca
2015-07-22 16:44:07 -04:00
parent 94031a251f
commit 57cb3981a0
100 changed files with 2085 additions and 0 deletions

View File

@ -0,0 +1,13 @@
Sarah Palindrome
================
Write a function that when given a word or sentence returns True if it is a palindrome and False if it isn't.
Your program should accept input using sys.argv.
```
python3 palindrome.py Taco Cat # returns true
```
You will want to make this case insensitive (Cat == cat). You can do this by make all letters upper or lower case.
You will also want to use strip to remove all non word characters.
Make the asserts pass and write more assert statements to test your code.

View File

@ -0,0 +1,12 @@
import sys
def is_palindrome(string):
pass
#TESTS
assert(is_palindrome("greg is the man") == False), "Presumably random sentence should return false"
assert(is_palindrome("No Mel Gibson is a casino's big lemon") == True), "Palindrome should return true"