-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
Panagram Script Added #1564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Panagram Script Added #1564
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4e6c0b1
Python Program that fetches top trending news
f451d51
Python Program that fetches top trending news
f46a6b7
Revisions in Fetch BBC News
258d73f
psf/black Changes
6e6dd6b
Python Program to send slack message to a channel
7578eb4
Merge branch 'master' into master
SKAUL05 8d74643
Slack Message Revision Changes
ad38a17
Merge branch 'master' of https://github.com/SKAUL05/Python-1
eb98b3a
Python Program to check Palindrome String
60f5ba2
Doctest Added
19f8ef5
Python Program to check whether a String is Panagram or not
9ef2d40
Python Program to check whether a String is Panagram or not
3bde45b
Check Panagram Script Added
d5c95ab
Panagram Script Added
e8dd7a6
Anagram Script Changes
28d7b62
Anagram Alphabet Check Added
625206c
Python Program to fetch github info
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Created by sarathkaul on 12/11/19 | ||
|
||
|
||
def check_panagram(input_str: str) -> None: | ||
""" | ||
A Panagram String contains all the alphabets at least once. | ||
>>> check_panagram("The quick brown fox jumps over the lazy dog") | ||
The quick brown fox jumps over the lazy dog is a Panagram String | ||
>>> check_panagram("My name is Unknown") | ||
My name is Unknown is not a Panagram String | ||
""" | ||
frequency = set() | ||
|
||
for alpha in input_str: | ||
if alpha != " ": | ||
frequency.add(alpha.lower()) | ||
SKAUL05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if len(frequency) == 26: | ||
print(f"{input_str} is a Panagram String") | ||
else: | ||
print(f"{input_str} is not a Panagram String") | ||
SKAUL05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
if __name__ == "main": | ||
check_panagram("INPUT STRING") | ||
SKAUL05 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Created by sarathkaul on 12/11/19 | ||
|
||
import requests | ||
|
||
|
||
def send_slack_message(message_body: str, slack_url: str) -> None: | ||
headers = {"Content-Type": "application/json"} | ||
response = requests.post(slack_url, json={"text": message_body}, headers=headers) | ||
if response.status_code != 200: | ||
raise ValueError( | ||
f"Request to slack returned an error {response.status_code}, " | ||
f"the response is:\n{response.text}" | ||
) | ||
|
||
|
||
if __name__ == "main": | ||
# Set the slack url to the one provided by Slack when you create the webhook at https://my.slack.com/services/new/incoming-webhook/ | ||
send_slack_message("<YOUR MESSAGE BODY>", "<SLACK CHANNEL URL>") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.