Share your repls and programming experiences

← Back to all posts
Deck of cards game
YesunErdeneBatb (3)

players = ['Yesun','Player2']

player1_name = input("Enter your name")

if player1_name in players:
print ("welcome player")
else:
print ("Not Available")

import random
cards = ['A2,''A3','A4','A5','C4','C6','C8']

print (cards)
random.shuffle(cards)
print (cards)

deck = ['A2,''A3','A4','A5','C4','C6','C8','H9']
p1_hand = []
p2_hand = []

p1_hand.append(deck.pop(0))
p2_hand.append(deck.pop(1))
p1_hand.append(deck.pop(2))

print(p1_hand)
print(p2_hand)

p1_hand = ['A2'',A4'',H9'',C8']
p2_hand = ['C4','C6','A5','A3']

p1_suit = p1_hand[0]
p2_suit = p2_hand[0]
p1_suit = p2_suit[0.1]
p2_suit = p2_suit[0.1]

p1_value = p1_hand[0]
p2_value = p2_hand[0]
p1_value = p1_value[1:2]
p2_value = p2_value[1:2]

if p1_suit=="A" and p2_suit=="C"
print ("Player 1 wins ")
if p1_suit=="A" and p2_suit=="H":
print ("Player 1 wins ")