A simple card game problem using conditional statements

Asked 1 weeks ago, Updated 1 weeks ago, 1 views

[Input Example 1]

HEART
RED
3
CLOVER
GREEN
1

[Output Example 1]

player1 win, player2 lose

[Input Example 2]

CLOVER
RED
10
HEART
GREEN
2

[Output Example 2]

player1 lose, player2 win

[Input Example 3]

HEART
RED
2
HEART
GREEN
5

[Output Example 3]

draw

I'm using conditional sentences, but I don't know.

python conditional-statement

2022-09-20 10:55

2 Answers

HEART, CLOVER, RED, GREEN, etc. should be compared with the string.

if image2 == "CLOVER":

Try changing it this way.


2022-09-20 10:55


2022-09-20 10:55

If you have any answers or tips


© 2022 pinfo. All rights reserved.