Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Pangram with comments. solution in Clear category for Pangram by vurutana
# 1. Import string module from std. library.
# 2. Convert all letters in given text to lowercase.
# 3. Get all latin letters.
# 4. Still iteration letters we have two cases:
# a).if letter occurs in our text - loop is continue,
# and it cuts letter letters from
# b).if letter does not ossur in our text - loop stops immediately
# 5. Func returns True if it is normal exit from the loop.
def check_pangram(text):
# 1.
import string
# 2.
text = text.lower()
# 3.
letters = string.ascii_lowercase
# 4.
for letter in letters:
# a)
if letter in text:
#
letters = letters[1:]
# b)
else:
return False
# 5.
return True
Nov. 2, 2018
Comments: