Skip to content

Commit 38d99c9

Browse files
Sarath Kaulstokhos
Sarath Kaul
authored andcommitted
Panagram Script Added (TheAlgorithms#1564)
* Python Program that fetches top trending news * Python Program that fetches top trending news * Revisions in Fetch BBC News * psf/black Changes * Python Program to send slack message to a channel * Slack Message Revision Changes * Python Program to check Palindrome String * Doctest Added * Python Program to check whether a String is Panagram or not * Python Program to check whether a String is Panagram or not * Check Panagram Script Added * Panagram Script Added * Anagram Script Changes * Anagram Alphabet Check Added * Python Program to fetch github info
1 parent 7500c10 commit 38d99c9

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

Diff for: strings/check_panagram.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Created by sarathkaul on 12/11/19
2+
3+
4+
def check_panagram(
5+
input_str: str = "The quick brown fox jumps over the lazy dog",
6+
) -> bool:
7+
"""
8+
A Panagram String contains all the alphabets at least once.
9+
>>> check_panagram("The quick brown fox jumps over the lazy dog")
10+
True
11+
>>> check_panagram("My name is Unknown")
12+
False
13+
>>> check_panagram("The quick brown fox jumps over the la_y dog")
14+
False
15+
"""
16+
frequency = set()
17+
input_str = input_str.replace(
18+
" ", ""
19+
) # Replacing all the Whitespaces in our sentence
20+
for alpha in input_str:
21+
if "a" <= alpha.lower() <= "z":
22+
frequency.add(alpha.lower())
23+
24+
return True if len(frequency) == 26 else False
25+
26+
27+
if __name__ == "main":
28+
check_str = "INPUT STRING"
29+
status = check_panagram(check_str)
30+
print(f"{check_str} is {'not ' if status else ''}a panagram string")

Diff for: web_programming/fetch_github_info.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Created by sarathkaul on 14/11/19
2+
3+
import requests
4+
5+
_GITHUB_API = "https://api.github.com/user"
6+
7+
8+
def fetch_github_info(auth_user: str, auth_pass: str) -> None:
9+
# fetching github info using requests
10+
info = requests.get(_GITHUB_API, auth=(auth_user, auth_pass))
11+
12+
for a_info, a_detail in info.json().items():
13+
print(f"{a_info}: {a_detail}")
14+
15+
16+
if __name__ == "main":
17+
fetch_github_info("<USER NAME>", "<PASSWORD>")

0 commit comments

Comments
 (0)