I need assistance. I am trying to program a game of Dice poker on python. I have two-thirds completed all of the programmings but have come across a slight hiccup. I have used both Integers and Lists to compute what numbers were rolled and how many times they appeared for both the player and dealer(computer). I have then coded up to determine whether who won, loss or if it was a draw, but it seems that it won't work because I have used both Integers and Lists. Is there a way to use both Integers and Lists or would I have to use only one?
die_count = [0,0,0,0,0,0,0]
die_index = 0
while die_index < len(player_hand):
die_count[die_value] += 1
die_index += 1
print(die_count)
This is what I have coded to calculate how many times a specific number in its index has appeared, from rolling 5 dice
if 5 in die_count and die_count1 < 5 in die_count:
print("** Player Wins! **")
print("** Dealer Loses! **")
elif 4 in die_count and 1 in die_count and die_count1 < 4 in die_count and 1 in die_count:
print("** Player Wins! **")
print("** Dealer Loses! **")
elif 3 in die_count and 2 in die_count and die_count1 < 3 in die_count and 2 in die_count:`
print("** Player Wins! **")
print("** Dealer Loses! **")
elif 3 in die_count and die_count1 < 3 in die_count:
print("** Player Wins! **")
print("** Dealer Loses! **")
elif 4 in die_count and die_count1 < 4 in die_count:
print("** Player Wins! **")
print("** Dealer Loses! **")
elif 2 > die_count and die_count1 < 2:
print("** Player Wins! **")
print("** Dealer Loses! **")
elif 5 in die_count1 and die_count < 5 in die_count1:
print("** Player Loses! **")
print("** Dealer Wins! **")
elif 4 in die_count1 and 1 in die_count1 and die_count < 4 in die_count1 and 1 in die_count1:
print("** Player Loses! **")
print("** Dealer Wins! **")
elif 3 in die_count1 and 2 in die_count1 and die_count < 3 in die_count1 and 2 in die_count1:
print("** Player Loses! **")
print("** Dealer Wins! **")
elif 3 in die_count1 and die_count < 3 in die_count1:
print("** Player Loses! **")
print("** Dealer Wins! **")
elif 4 in die_count1 and die_count < 4 in die_count1:
print("** Player Loses! **")
print("** Dealer Wins! **")
elif 2 in die_count1 and die_count < 2 in die_count1:
print("** Player Loses! **")
print("** Dealer Wins! **")
elif 5 in die_count and 5 in die_count1:
print("** Draw! **")
elif 4 in die_count and 1 in die_count and 4 in die_count1 and 1 in die_count1:
print("** Draw! **")
elif 3 in die_count and 2 in die_count and 3 in die_count1 and 2 in die_count1:
print("** Draw! **")
elif 3 in die_count and 3 in die_count1:
print("** Draw! **")
elif 4 in die_count and 4 in die_count1:
print("** Draw! **")
elif 2 in die_count and 2 in die_count1:
print("** Draw! **")
This is what I have coded to determine whether who won, loss, etc.
When I try to run the program it comes up by saying that either '>' or '<' is not supported between instances of 'int' and 'list'. What I am trying to say by wording the huge bit of code, is that if the either player's/dealer's hand is less than the other's hand, then it prints the obligated response.