Question: Having issues getting this to print both the card number and suite in python. The card number seems to be working fine but not the

Having issues getting this to print both the card number and suite in python. The card number seems to be working fine but not the suite what am I missing?

def main(): # variable cardNotation = input("Enter card notation: ") if len(cardNotation) is 2: if cardNotation[0] is "K": print("King of ",end="") elif cardNotation[0] is "Q": print("Queen of ",end="") elif cardNotation[0] is "J": print("Jack of ",end="") elif cardNotation[0] is "A": print("Ace of ",end="") elif cardNotation[0].isdigit(): print(cardNotation[0],"of ",end="") if cardNotation[0] is "D": print("Diamonds") elif cardNotation[0] is "H": print("Heart") elif cardNotation[0] is "S": print("Spade") elif cardNotation[0] is "C": print("Club")

if len(cardNotation) is 3: if cardNotation[0] is "1" and cardNotation[1] is "1": print("10 of ",end="")

if cardNotation[2] is "D": print("Diamonds") elif cardNotation[2] is "H": print("Heart") elif cardNotation[2] is "S": print("Spade") elif cardNotation[2] is "C": print("Club")

main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!