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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started