Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

List three types of CPU registers and briefly define their tasks.

Answered: 1 week ago

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago