Lab3003
  • FacultyAlgorithmChallenge
  • README
  • Question Bank
  • Python Documentation
    • BetterMap
    • Board
    • Card
    • Circle
    • Deck
    • README.md
    • Guide For Bookmarklet
    • Hand
    • HashMap
    • Hist
    • Kangaroo
    • LinearMap
    • Markov
    • Point
    • PokerDeck
    • PokerHand
    • Rectangle
    • State
    • Test
    • ThinkPython
    • ThinkPython2
    • Time
    • Think Python
    • thinkpython
  • Files
  • Image Files
  • lab
    • InsertSortTDD
    • countingBits
    • cs3003mergeSortLectureGuideLine
    • index_min
    • insort
    • One-line factorial function in Python
  • Manual for Python Lab
    • COURSE OBJECTIVES
    • 1_timelines
    • FDPNotes
    • PC-2_Python
    • lab1-kgashok.py
    • Lab 10 :Matrix Multiplication
    • Lab 11: Programs that take command line arguments (word count)
    • Lab 11: Programs that take command line arguments
    • Lab 12: Compute the most frequently used words from the text file
    • Lab 12: Find the most frequent words in a text read from a file
    • Lab 12a: File content sorter
    • Lab 2: Find the square root of a number (Newton’s method)
    • Lab 3: Compute power of a number (Exponentiation)
    • Lab 3: Exponentiation (power of a number)
    • lab4-binaraysearch-anvar.py
    • Solution for Binary Search
    • lab4-joelanandraj-binarysearch.py
    • Lab 4: Linear and Binary Search
    • lab4-lin-anvar.py
    • Linear Searcher
    • Lab 5 : find n prime numbers
    • lab6-kgashok.py
    • lab7-kgashok.py
    • lab8-kgashok.py
    • Lab 8: Selection and Insertion sort using Python
    • Merge Sort
    • Quick Sort
    • labSheet
    • pc0
    • sortPythonic
    • Sorting
  • misc
    • Bookmarklets
    • Guide For Bookmarklet
    • pythonResources
    • FDP for Python
    • Agenda for Workshop
      • Agenda
  • notes
    • Problem Set
    • InsertSortTDD
    • MergeSort
    • cs3003-unit1-notes
    • cs3003-unit3
    • cs3003-unit4-examples
    • Unit 4 Lists, Tuples and Dictionaries
    • cs3003insertsortLectureGuide
    • cs3003mergeSortLectureGuideLine
    • Designing and Delivering Effective Lectures
    • histogram.py
    • selectSortLectureGuide
  • Sandbox to try ThinkPy2 code
    • Code from ThinkPython Github repository
  • Important Topics
    • 3003-syllabus
    • GE8161 PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY L T P C
    • Unit II Version 2
    • Unit IV material
    • UNIT III CONTROL FLOW, FUNCTIONS
    • Unit 1 Algorithm Problem Solving
    • Unit_V_Notes
    • UpdatedSyllabus
    • glossary
    • glossaryGeneration.py
    • importantTopics-kgashok
    • memCSV
    • Tower of Hanoi
    • Notes for Unit 2 - Illustrative programs
    • unit5-updated_notes
    • unit_1_notes
    • Unit 3 Control Flow Version 1
    • unit 3
      • UNIT III CONTROL FLOW, FUNCTIONS
    • unit_i_img
Powered by GitBook
On this page
  • Methods
  • make_histograms
  • has_highcard
  • check_sets
  • has_pair
  • has_twopair
  • has_threekind
  • has_fourkind
  • has_fullhouse
  • has_flush
  • has_straight
  • in_a_row
  • has_straightflush
  • has_straightflush
  • classify
  1. Python Documentation

PokerHand

Represents a poker hand.

Methods

make_histograms

Computes histograms for suits and hands. Creates attributes: suits: a histogram of the suits in the hand. ranks: a histogram of the ranks. sets: a sorted list of the rank sets in the hand.

Parameters

name
description
default

self

has_highcard

Returns True if this hand has a high card.

Parameters

name
description
default

self

check_sets

Checks whether self.sets contains sets that are at least as big as the requirements in t. t: list of int

Parameters

name
description
default

self

has_pair

Checks whether this hand has a pair.

Parameters

name
description
default

self

has_twopair

Checks whether this hand has two pair.

Parameters

name
description
default

self

has_threekind

Checks whether this hand has three of a kind.

Parameters

name
description
default

self

has_fourkind

Checks whether this hand has four of a kind.

Parameters

name
description
default

self

has_fullhouse

Checks whether this hand has a full house.

Parameters

name
description
default

self

has_flush

Checks whether this hand has a flush.

Parameters

name
description
default

self

has_straight

Checks whether this hand has a straight.

Parameters

name
description
default

self

in_a_row

Checks whether the histogram has n ranks in a row. hist: map from rank to frequency n: number we need to get to

Parameters

name
description
default

self

ranks

n

5

has_straightflush

Checks whether this hand has a straight flush. Clumsy algorithm.

Parameters

name
description
default

self

has_straightflush

Checks whether this hand has a straight flush. Better algorithm (in the sense of being more demonstrably correct).

Parameters

name
description
default

self

classify

Classifies this hand. Creates attributes: labels:

Parameters

name
description
default

self

PreviousPokerDeckNextRectangle

Last updated 3 years ago