|
def isPangram(sentence):
True if the sentence is a pangram, or
return False if it is not.>>> from project2 import isPangram
>>> isPangram("Quick brown fox jumps over the lazy dog.")
True
>>> isPangram("Quick brown fox trips over the sly dog.")
False
>>> answer = isPangram("abcdefghijklmnopqrstuvwxyz")
>>> print(answer) # note: depends on returned value
Truedef isPalindrome(text):
True if the text forms a palindrome, or
return False if it does not.>>> from project2 import isPalindrome
>>> isPalindrome("Madam, I'm Adam.")
True
>>> isPalindrome("abcda")
False
>>> answer = isPalindrome('Ada')
>>> print(answer) # note: depends on returned value
TrueWe suggest you solve this problem in two parts, and the points will be allocated accordingly:
The function header must exactly match the following:
def pigLatin(text):
Here are some sample runs of our pigLatin solution:
>>> from project2 import pigLatin
>>> pigLatin('banana')
'ananabay'
>>> p = pigLatin("Apple")
>>> print(p) # note: depends on returned value of p
Appleway
>>> pigLatin('Square')
'Aresquay'
>>> pigLatin('My hovercraft is full of eels.')
'Ymay overcrafthay isway ullfay ofway eelsway.'
>>> pigLatin('FDA says: "Three squares is the way to go!"')
'AFDAY ayssay: "Eethray aressquay isway ethay ayway otay ogay!"'
cd to the
same directory as your source code file, then type the following (careful -
turning in to uppercase P-two, P2, at class account cs8c):
turnin P2@cs8c project2.pyIf you are working with a partner, be sure that both partners names are in a comment at the top of the file.