how to make a poker game in python

Solutions on MaxInterview for how to make a poker game in python by the best coders in the world

showing results for - "how to make a poker game in python"
Fabio
23 Jan 2020
1#poker
2print("poker username: ")
3name = input("")
4print("age: ")
5age = input("")
6
7#continue
8input("\n\nPress the [enter key]")
9
10#make random cards by importing
11import random
12
13#player cards
14print("your cards: ")
15card1 = random.randint(1, 12)
16card2 = random.randint(1, 12)
17player_cards = card1, card2
18print(player_cards)
19
20#first table cards
21table1 = random.randint(1, 12)
22table2 = random.randint(1, 12)
23table3 = random.randint(1, 12)
24table_full = table1, table2, table3
25print("the first table cards are:")
26print(table_full)
27
28#bet
29print("put in the amount you would like to bet")
30bet1 = input("")
31
32#next table card
33table4 = random.randint(1, 12)
34print("full table is now: ")
35table = table1, table2, table3, table4
36print(table)
37
38#bet number 2
39print("put in the amount you would like to bet")
40bet2 = input("")
41
42#next next table card
43table5 = random.randint(1, 12)
44print("full table is now: ")
45table12345 = table1, table2, table3, table4, table5
46print(table12345)
47
48#loser or winner?
49print("player2 had: ")
50card12 = random.randint(1, 12)
51card22 = random.randint(1, 12)
52player2 = card12, card22
53print(player2)
54
55#full layout
56print("this is the full table now")
57print(player_cards)
58print(table12345)
59print(player2)
60
61#play again?
62play = input("do you want to play again")
63if play == "yes":
64    exec(open("./pokerface.py").read())
65else:
66        exit()