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
| """ | |
| Read/Extract Mails using python | |
| Requirements : | |
| 1. imaplib, 2. OS, 3. base64, 4. email | |
| 5. emai.parser -> BytesParser (for parsing the data | |
| stored inside a file or variable). | |
| """ | |
| import imaplib # For reading messages | |
| import logging # For catching logs |
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
| #/home/hi-man/anaconda3/bin/python | |
| import os | |
| import discord | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| token = os.getenv('DISCORD_TOKEN') | |
| guild = os.getenv('CONSTRUCT_CODES') | |
| client = discord.Client() |
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
| # Implementing Linked Binary Tree | |
| # ____________ | |
| # |L |PARENT|R_| | |
| # |L_|_DATA_|R_| | |
| from tree import BinaryTree | |
| class LinkedBinaryTree(BinaryTree): | |
| class _Node: |
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
| # creating n*n matrix | |
| # Partially solved | |
| import numpy as np | |
| from sys import stdin, stdout | |
| def printDiagonalSum(mat, n): | |
| sum_ = 0 | |
| for i in range(0, n): | |
| sum_ += mat[i,i] |
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
| class Stack: | |
| def __init__(self, n): | |
| self.array = [] | |
| self.n = n | |
| def __len__(self): | |
| return len(self.array) | |
| def is_empty(self): |
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
| import random | |
| suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs') | |
| ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace') | |
| values = {'Two':2, 'Three':3, 'Four':4, 'Five':5, 'Six':6, 'Seven':7, 'Eight':8, 'Nine':9, 'Ten':10, 'Jack':10, 'Queen':10, 'King':10, 'Ace':11} | |
| playing = True | |
| class Card: | |
| def __init__(self, suits, ranks): |
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
| """ Playing Tic Tac Toe with Computer """ | |
| import random | |
| BOARD_VALUE = {} | |
| for number in range(1, 10): | |
| BOARD_VALUE[number] = " " | |
| COMP_MOVES = BOARD_VALUE.keys() | |
| COMP_MOVES = list(COMP_MOVES) |
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
| import string | |
| import time | |
| # pattern = r'[\W_ ]' - regex pattern | |
| def convert(data): | |
| new_data = '' | |
| for i in range(0, len(data)): | |
| if data[i] in string.ascii_letters: |
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
| import time | |
| import re | |
| import string | |
| pattern = r".*?[\W]+" | |
| # 1 - enumerate and methods | |
| data = [ | |
| "Correct,", |
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
| # Regex -> Searching , Sending | |
| import os | |
| import re | |
| import shutil | |
| import sys | |
| from time import sleep | |
| from pprint import pprint | |
| found_files = [] |
NewerOlder