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 os | |
| import openpyxl | |
| from pathlib import Path | |
| dir_containing_files = os.getcwd() + '\\data' | |
| # print(dir_containing_files) | |
| # print(type(dir_containing_files)) | |
| dest_wb = openpyxl.Workbook() | |
| collectables = [] | |
| for root, dir, filenames in os.walk(dir_containing_files): |
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
| var mainContentElem = document.getElementById('MainContent'); | |
| var indexOfRecentSlider = 0; | |
| var recentlyViewedSection = document.createElement('div'); | |
| recentlyViewedSection.id = 'customRecentlyViewedSection'; | |
| recentlyViewedSection.classList.add('shopify-section'); | |
| recentlyViewedSection.classList.add('index-section'); | |
| var parentPageWidthDiv = document.createElement('div'); | |
| recentlyViewedSection.appendChild(parentPageWidthDiv); |
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 csv | |
| import sys | |
| # print('x') | |
| def main(inputFile, outputFile): | |
| myFile = open(inputFile, "r") | |
| with open(outputFile, 'w', newline='') as file: | |
| writer = csv.writer(file) | |
| writer.writerow(["Date", "Name", "IP", "Description"]) |
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
| def camelCase(text): | |
| textLength = len(text) | |
| outText = '' | |
| nextOneIsCapital = False | |
| for i in range(textLength): | |
| if i is 0: | |
| outText = outText + text[i].lower() | |
| else: | |
| if text[i] is not ' ': | |
| if nextOneIsCapital: |
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
| count = 0 | |
| for i in range(4): | |
| # print(i) | |
| jloop = i + 1 | |
| for j in range(jloop): | |
| print(count, end="->") | |
| count = count + 1 | |
| print("") |
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
| for i in range(10): | |
| # Everything here executes ten time | |
| print(i) | |
| # This loop ends here because the next line doesn't have a TAB Space in front. | |
| for i in range(15): | |
| print(i) | |
| #This loop ends here. | |
| print("Jannat") |
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
| # Score starts with zero. | |
| scores = [300, 500, 500, 0, 600] | |
| lives = 3 # Default 3 lives | |
| # Game state negative means means Start Menu | |
| # Positive means Playing | |
| gameState = 0 | |
| print("Playing") | |
| for score in scores: | |
| if lives is 0: |
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
| def minimumSwaps(arr): | |
| arr = [x - 1 for x in arr] | |
| i = 0 | |
| count = 0 | |
| while i < len(arr): | |
| # print(i) | |
| temp = arr[i] | |
| if(i != arr[i]): | |
| arr[i] = arr[temp] | |
| arr[temp] = temp |