Skip to content

Instantly share code, notes, and snippets.

View theseoriddler's full-sized avatar

Sara Taher theseoriddler

View GitHub Profile
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
api_key='ADD_YOUR_API_KEY_HERE'
youtube=build(
'youtube',
'v3',
developerKey=api_key
)
@theseoriddler
theseoriddler / WordCounter.py
Last active May 22, 2023 22:49
Code to open a file "duplicatelines.txt", count words, then lists how many time each word was repeated.
myfile = open("LearningPy/duplicatelines.txt","r") #replace with your file name
xString = myfile.readlines()
listOfWords = []
for x in range(len(xString)):
line = xString[x]
#print(line)
@theseoriddler
theseoriddler / dice.py
Created May 22, 2023 17:41
A code to roll an X number of dice and generate results based off the number of sides the dice has
import random as rnd
#ask user for number of dice
nDice = input("How many dice are we playing with? \n")
nSides = input("\nhow many sides each dice has? \n")
msg = "we're rolling "+nDice+" dice. Here are the results:\n"
try:
for x in range(int(nDice)):