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):
from flask import Flask | |
from threading import Thread | |
app = Flask('') | |
@app.route('/') | |
def home(): | |
return "Hello. I am alive!" | |
def run(): |
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):
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).
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 |
<img src="https://people.engr.ncsu.edu/efg/210/s99/Notes/LLdefs.gif" alt="" width="600px"/> |
@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}" |
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 |