Skip to content

Instantly share code, notes, and snippets.

View beaucarnes's full-sized avatar
💭
Follow me on Twitter: @beaucarnes

Beau Carnes beaucarnes

💭
Follow me on Twitter: @beaucarnes
View GitHub Profile
@beaucarnes
beaucarnes / keep_alive.py
Created December 10, 2020 15:42
Python Server for Discord Bot
from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Hello. I am alive!"
def run():
@beaucarnes
beaucarnes / python-blackjack-hand.md
Last active August 10, 2023 19:24
python-blackjack-hand.md

350

Besides keeping track of the cards, Hand should also keep track of the value. Under self.cards, create self.value and set it to 0.


class Hand:
 def __init__(self):
@beaucarnes
beaucarnes / python_blackjack_instructions.md
Last active August 10, 2023 19:22
python_blackjack_instructions.md

TOTAL STEPS: 140

You are going to build a blackjack card game in Python.

Every card in blackjack has a suit, rank, and value. For example, the king of hearts has a rank of "king", a suit of "hearts", and a value of 10 (In blackjack, face cards are worth 10).


Demographic Data Analyzer

In this challenge you must anaylize demographic data using Pandas. You are given a dataset of demographic data. Here is a sample of what the data looks like:

   age         workclass  fnlwgt  education  education-num      marital-status  ...     sex capital-gain capital-loss hours-per-week  native-country  salary
0   39         State-gov   77516  Bachelors             13       Never-married  ...    Male         2174            0             40   United-States   <=50K
1   50  Self-emp-not-inc   83311  Bachelors             13  Married-civ-spouse  ...    Male            0            0             13   United-States   <=50K
2   38           Private  215646    HS-grad              9            Divorced  ...    Male            0            0             40   United-States   <=50K
import random
def get_choices():
player_choice = input("Enter a choice (rock, paper, scissors): ")
options = ["rock", "paper", "scissors"]
computer_choice = random.choice(options)
choices = {"player": player_choice, "computer": computer_choice}
return choices
@beaucarnes
beaucarnes / index.html
Created June 4, 2017 10:28
Linked List
<img src="https://people.engr.ncsu.edu/efg/210/s99/Notes/LLdefs.gif" alt="" width="600px"/>
@beaucarnes
beaucarnes / index.css
Created June 11, 2018 12:15
From 'Learn HTML5' course
@import url(https://use.fontawesome.com/releases/v5.0.6/css/all.css);
#home {
--first-color: #674ea7;
--second-color: #f4e767;
--light-gray: lightgray;
}
#next {
--first-color: tomato;
--second-color: deepskyblue;
import random
class Card:
def __init__(self, suit, rank):
self.suit = suit
self.rank = rank
def __str__(self):
return f"{self.rank['rank']} of {self.suit}"
@beaucarnes
beaucarnes / polygon-calculator.py
Created July 26, 2021 13:32
polygon-calculator.py
class Rectangle:
def __init__(self, width, height):
self.width = width
self.height = height
def __repr__(self):
return f"Rectangle(width={self.width}, height={self.height})"
def set_width(self, num):
self.width = num