This file contains 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
#include <LiquidCrystal.h> | |
// initialize the library with the numbers of the interface pins | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); | |
byte Alien[] = { | |
B11111, | |
B10101, | |
B11111, | |
B11111, |
This file contains 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
save_file = "passwords.txt" | |
logins = {} | |
customer = {"name": "google", "email": "[email protected]" | |
def save_data(): | |
with open(save_file, "w") as f: | |
f.write(str(d)) | |
def load_data(): |
This file contains 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
#include <Adafruit_NeoPixel.h> | |
#define LED_PIN 2 | |
#define NUM_LEDS 12 | |
Adafruit_NeoPixel pixels(NUM_LEDS, LED_PIN, | |
NEO_GRB + NEO_KHZ800); | |
void setup() | |
{ |
This file contains 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 cs50 import SQL | |
db = SQL("sqlite:///students.db") | |
name = input("Name: ") | |
student_id = db.execute("INSERT INTO people (name) VALUES (?)", name) | |
course_id = int(input("Course id: ")) | |
results = db.execute("SELECT id FROM courses WHERE id = ?", course_id) | |
if len(results) == 0: |
This file contains 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 flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route("/") | |
def index(): | |
return render_template("index.html", name="Emily") |
This file contains 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
# Validating input | |
while True: | |
try: | |
num = int(input("Pick a number from 1 to 10: ")) | |
except ValueError: | |
continue | |
if num >= 1 and num <= 10: | |
break |
This file contains 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
numbers = [1, 5, 0, 39, 6, 809, 39, 2] | |
biggest = numbers[0] | |
for num in numbers: | |
if num > biggest: | |
biggest = num | |
print(biggest) |
This file contains 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
# Points assigned to each letter of the alphabet | |
POINTS = {"a": 1, "b": 3, "c": 3, "d": 2, "e": 1, | |
"f": 4, "g": 2, "h": 4, "i": 1, "j": 8, | |
"k": 5, "l": 1, "m": 3, "n": 1, "o": 1, | |
"p": 3, "q": 10, "r": 1, "s": 1, "t": 1, | |
"u": 1, "v": 4, "w": 4, "x": 8, "y": 4, | |
"z": 10} | |
def score(word): | |
# TODO: Compute and return score for a word |
This file contains 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
<html> | |
<head> | |
<title>My First Page</title> | |
<style> | |
body { | |
font-family: Arial, Helvetica, sans-serif; | |
color: green; | |
background: #cfb87e; | |
} | |
p { |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Mr. Bradfield's Classes</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<!--navigation bar--> | |
<ul class="nav"> | |
<li class="nav"><a href="index.html">Home</a></li> |