Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In Python 3 Write a function to determine if a sentence is a \"pangram\" or not.

ID: 3837462 • Letter: I

Question

In Python 3

Write a function to determine if a sentence is a "pangram" or not. A pangram, also known as a "holoalphabetic sentence s a sentence that contains every letter of the alphabet. Here are some example pangrams: The quick brown fox jumps over the lazy dog. A very bad quack might jinx zippy fowls. Pack my box with five dozen liquor jugs. As you can see it does not matter if the letters are upper or lower case, and of course spaces and punctuation are ignored. The function header must exactly match the following: def isPangram (sentence): Return (don't print) True if the sentence is a pangram, or return False if it is not Test your function in the Python shell. Here are sample tests of our solution > > > 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 is Pangram ("abcdefghijklmnopqrstuvwxyz") > > > print (answer) # note depends on returned value True

Explanation / Answer

line1 = "The quick brown fox jumps over the lazy dog"
line2 = "This is test "
line3 = "Quick brown fox trips over the sly dog"
line4 = "abcdefghijklmnopqrstuvwxyz"

def isPangram(line):
count = 0
alphabet = "abcdefghijklmnopqrstuvwxyz"
Letters = ""
for char in line:
for letter in alphabet:
if char == letter and char not in Letters:
Letters += char
for char in Letters:
for letter in alphabet:
if char == letter:
count += 1
if count == 26:
return True
else:
return False

print isPangram(line1)
print isPangram(line2)
print isPangram(line3)
print isPangram(line4)

----------------------------------------------------------

//output

//output
True
False   
False   
True

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote