+ 1
compare two dictionaries
import random print("highest card wins \n") print(" S = spades.\n H = hearts.\n C = clubs.\n D = diamonds.\n J = big joker.\n j = small joker.\n") P1=input("press enter to draw your card\n player one: ") print("player one drew ") myList = {"Sk": 10, "Sq": 10, "Sj": 10, "Sa": 11, "S1": 1,} myList=random.choice(list(myList)) print(myList) P2=input(" \npress enter to draw your card\n player two: ") print("player two drew ") myList1 = {"Sk": 10, "Sq": 10, "Sj": 10, "Sa": 11, "S1": 1,} myList1=random.choice(list(myList1)) print(myList1) is there a way to print something if one choice is higher or lower than the other?
2 odpowiedzi
+ 2
Maybe if you use something like...
If myList>myList1:
print("Your card is bigger than your opponent card")
+ 2
https://code.sololearn.com/c1buO3d8AvxC/?ref=app
Idk if this will help you but i will post it just for you to see.