443 views
5 votes
Python Assignment

I need to create a card game which 2 users can play. Generate 3 random cards to suits and value for each user. Find the biggest value of each and add to their own point counter. Display which of the values is bigger in each turn taken. While loop until user doesnt want to play anymore, display points earned by each user and say who won. Functions! I need to use functions and return the values. Thank u!! Please help urgently!​

Python Assignment I need to create a card game which 2 users can play. Generate 3 random-example-1
User Keruilin
by
5.5k points

1 Answer

6 votes

Answer:

View Image

Step-by-step explanation:

Import randint() so you can use it.

Create a nested list (pretty much a 2D array) to store the value of the suite and card.

Ask for user's name.

Generate the suite and card value using loops.

Create a function to convert the card value to J Q K if it's 11, 12, or 13.

Create a function to convert the card suite to it's respective symbol.

Create a function to check the highest value to print out its value.

Python Assignment I need to create a card game which 2 users can play. Generate 3 random-example-1
Python Assignment I need to create a card game which 2 users can play. Generate 3 random-example-2
Python Assignment I need to create a card game which 2 users can play. Generate 3 random-example-3
User Magofoco
by
5.9k points