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 get_indices(s, lst): | |
indice = list() | |
indices = list() | |
toReturn = '' | |
for char in lst: | |
for i in range(len(s)): | |
if s[i] == char: | |
indice.append(i) | |
indices.append(indice) | |
indice = [] |
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
enum INFRARED_SENSORS{IR_1 = 2, IR_2 = 3}; | |
enum MOTORS{M1_enA = 5, M1_in1 = 9, M1_in2 = 10, M2_enB = 6, M2_in3 = 11, M2_in4 = 12}; | |
// -------------------------------- defining pins ----------------------------------- | |
extern int M1[3] = {M1_enA, M1_in1, M1_in2}; | |
extern int M2[3] = {M2_enB, M2_in3, M2_in4}; | |
// DC motor pins (motor driver pins) | |
int IR1_reading, IR2_reading; | |
int LEFT, RIGHT; |
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
from random import random | |
import pygame | |
from pygame import Vector2 | |
WHITE = (255, 255, 255) | |
BLACK = (0, 0, 0) | |
RED = (255, 0, 0) | |
GREEN = (0, 255, 0) | |
BLUE = (0, 0, 255) |
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
from API_KEY import API_KEY | |
from googleapiclient.discovery import build | |
from googleapiclient.errors import HttpError | |
from json import dump | |
def get_video_comments(videoID: str, max_results: int = 20): | |
assert isinstance(videoID, str), f"videoID should be a string, received {videoID.__class__.__name__}" | |
assert isinstance(max_results, int) and 1 <= max_results <= 100, \ |
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 math | |
import pygame | |
from pygame import Vector2 | |
import pygame_widgets | |
from pygame_widgets.slider import Slider | |
from pygame_widgets.textbox import TextBox | |
pygame.init() |