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
-- Keep a log of any SQL queries you execute as you solve the mystery. | |
-- Get descriptions of the crimes that happened in 28-July(7)-2020 in the Chamberlin St. | |
SELECT description FROM crime_scene_reports WHERE day = "28" AND month = "7" AND year = "2020" AND street = "Chamberlin Street"; | |
-- Check the transcript of the theft date interviews mentioned by the courthouse. | |
SELECT transcript FROM interviews WHERE day = "28" AND month = "7" AND year = "2020" AND transcript like "%courthouse%"; | |
-- Based on transcript of the first interview: Finding the names of the people who exit the courthouse 10 minutes after the theft. | |
SELECT name FROM people JOIN courthouse_security_logs ON people.license_plate = courthouse_security_logs.license_plate WHERE day = "28" AND month = "7" AND year = "2020" AND hour = "10" AND minute >= "15" AND minute < "25" AND activity = "exit"; |
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
-- 1.sql | |
SELECT title FROM movies WHERE year LIKE "2008"; | |
-- 2.sql | |
SELECT birth FROM people WHERE name LIKE "Emma Stone"; | |
-- 3.sql | |
SELECT title FROM movies WHERE year>="2018" ORDER BY title; | |
-- 4.sql | |
SELECT COUNT(title) FROM movies WHERE id IN (SELECT movie_id FROM ratings WHERE rating LIKE "10.0"); | |
-- 5.sql | |
SELECT title, year FROM movies WHERE title LIKE "Harry Potter%" ORDER BY year; |
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
-- 1.sql | |
SELECT name FROM songs; | |
-- 2.sql | |
SELECT name FROM songs ORDER BY tempo; | |
-- 3.sql | |
SELECT name FROM songs ORDER BY duration_ms DESC LIMIT 5; | |
-- 4.sql | |
SELECT name FROM songs WHERE danceability > 0.75 AND energy > 0.75 AND valence > 0.75; | |
-- 5.sql | |
SELECT avg(energy) FROM songs; |
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 | |
import re | |
if len(sys.argv) != 3: | |
print("Usage: python dna.py data.csv sequence.txt") | |
# Read DNA sequence | |
with open(sys.argv[2], "r") as txt: | |
dna = txt.read(-1) |
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 sys import exit | |
# Get Text... | |
text = input("Text: ") | |
# Variables... | |
h = 0 | |
s = 0 | |
l = 0 | |
c = 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
from cs50 import get_float | |
c = 0 | |
# Get owe... | |
print("Write down the amount you owe to calculate the number of coins like ($.ยข)... ") | |
o = 0 | |
while True: | |
o = get_float("Owed: ") | |
if o > 0: | |
break |
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 cs50 import get_int | |
# Notification | |
print("Welcome, Please enter a number from one to eight to build.") | |
# Getting height. | |
h = 0 | |
while 1 > h or h > 8: | |
h = get_int("Height: ") | |
# Build. | |
for row in range(1, (h + 1), 1): |
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 cs50 import get_int | |
# Notification | |
print("Welcome, Please enter a number from one to eight to build.") | |
# Getting height. | |
h = 0 | |
while 1 > h or h > 8: | |
h = get_int("Height: ") | |
# Build. | |
for i in range(h): |
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
# Asking name | |
name = input("What's your name? ") | |
# Say Hello | |
print(f"Hello, {name}!") | |
print("I'm Moqi. Nice to meet you.") |
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
# Simulate a sports tournament | |
import csv | |
import sys | |
import random | |
# Number of simluations to run | |
N = 1000 | |
NewerOlder