how to make a poker game in python

#poker
print("poker username: ")
name = input("")
print("age: ")
age = input("")

#continue
input("\n\nPress the [enter key]")

#make random cards by importing
import random

#player cards
print("your cards: ")
card1 = random.randint(1, 12)
card2 = random.randint(1, 12)
player_cards = card1, card2
print(player_cards)

#first table cards
table1 = random.randint(1, 12)
table2 = random.randint(1, 12)
table3 = random.randint(1, 12)
table_full = table1, table2, table3
print("the first table cards are:")
print(table_full)

#bet
print("put in the amount you would like to bet")
bet1 = input("")

#next table card
table4 = random.randint(1, 12)
print("full table is now: ")
table = table1, table2, table3, table4
print(table)

#bet number 2
print("put in the amount you would like to bet")
bet2 = input("")

#next next table card
table5 = random.randint(1, 12)
print("full table is now: ")
table12345 = table1, table2, table3, table4, table5
print(table12345)

#loser or winner?
print("player2 had: ")
card12 = random.randint(1, 12)
card22 = random.randint(1, 12)
player2 = card12, card22
print(player2)

#full layout
print("this is the full table now")
print(player_cards)
print(table12345)
print(player2)

#play again?
play = input("do you want to play again")
if play == "yes":
    exec(open("./pokerface.py").read())
else:
        exit()

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source