Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Similar to Poker
#1
Hello, I was wondering if someone could help me out with my program I am currently trying to make, my program is similar to poker were I am generating four random cards and being able to tell the six possible options,

This is my random card selector: (yes it works no problem with that...)
import random
card = random.choice( ('1''2','3','4','5','6','7','8','9') ) 
card2 = random.choice( ('1''2','3','4','5','6','7','8','9') )
card3 = random.choice( ('1''2','3','4','5','6','7','8','9') )
card4 = random.choice( ('1''2','3','4','5','6','7','8','9') )
print(card, card2, card3, card4)
For example when you run the program it will give you four random cards each tine such as: 3 8 7 4 or 9 9 1 4 or 5 4 7 1 (etc.)

My question is how can you get the program to tell the person, who runs the program, what set of cards is it.....

For example:
Output:
Four of a kind (7 7 7 7) Three of a kind (3 3 9 3) Two pair (4 7 4 7) Nothing (3 7 2 8) Four Consecutive (A straight) (2 4 3 5)
Any help would be appreciated... Thanks!
Reply


Messages In This Thread
Similar to Poker - by bluekade5050 - Nov-14-2018, 01:45 PM
RE: Similar to Poker - by j.crater - Nov-14-2018, 04:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sum similar items tester_V 3 1,949 Jun-29-2021, 06:58 AM
Last Post: tester_V
  Hi! + Poker calculator SpookyKooks 2 2,162 Mar-12-2020, 05:32 AM
Last Post: SpookyKooks
  Python: if 'X' in 'Y' but with two similar strings as 'X' DreamingInsanity 6 3,855 Feb-01-2019, 01:28 PM
Last Post: buran
  Poker Dice while loop gullidog 2 7,037 May-28-2017, 08:07 PM
Last Post: gullidog

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020