-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalphabet_searching.py
42 lines (30 loc) · 1023 Bytes
/
alphabet_searching.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#Have the function AlphabetSearching(str) take the str parameter being passed and
# return the string true if every single letter of the English alphabet exists in the string,
# otherwise return the string false.
# For example: if str is "zacxyjbbkfgtbhdaielqrm45pnsowtuv" then your program should return the string true
# because every character in the alphabet exists in this string even though some characters appear more than once.
def AlphabetSearching(strParam):
new_str= strParam.lower()
result = ''
for letter in new_str:
if letter.isalpha():
result += letter
result = set(result)
if len(result)== 26:
return True
else:
return False
# code goes here
# keep this function call here
print(AlphabetSearching(input()))
import re
def AlphabetSearching(str):
str = str.lower()
chars = set(re.findall('[a-z]', str))
if len(chars) != 26:
return 'false'
else:
return 'true'
# code goes here
# keep this function call here
print(AlphabetSearching(input()))