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
import random | |
import time | |
suits = ['♣','♦','♥','♠'] | |
cards = ['K', 'Q', 'J', '10', '9', '8', '7', '6', '5', '4', '3', '2', 'A'] | |
values = {'K':10, 'Q':10, 'J':10, '10':10, '9':9, '8':8, '7':7, '6':6, '5':5, '4':4, '3':3, '2':2, 'A':1} | |
def deal(): | |
suit = random.choice(suits) |
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
import random | |
import time | |
import random | |
class Card: | |
def __init__(self, r, s): | |
self.rank = r | |
self.suit = s |
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
import random | |
def checkValue(guess, mysteryNumber, count): | |
if guess < 1 or guess > 10: | |
return count, 'Invalid guess' | |
if guess == mysteryNumber: | |
return count, 'Win' | |
if guess < mysteryNumber: | |
return count, 'Too Low' |
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
import random | |
numberOfGuesses = 0; | |
mysteryNumber = random.randint(1, 10) | |
while numberOfGuesses < 3: | |
guessUser1 = int(input("User1: Guess a number between 1-10: ")) | |
if guessUser1 < 0 or guessUser1 > 10: |