1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Travka [436]
3 years ago
14

Write a program that takes user input describing a playing card in the following short-hand notation:

Computers and Technology
1 answer:
siniylev [52]3 years ago
6 0

Answer:

In python Language:

cardNotation = raw_input("Enter card notation: ")

 

# Create a dict for values

 

cardColors = {"D": "Diamonds",

             "H": "Hearts",

             "S": "Spades",

             "C": "Clubs"}

 

cardNumberValues = {"A": "Ace",

                   "J": "Jack",

                   "Q": "Queen",

                   "K": "King",

                   "2": "Two",

                   "3": "Three",

                   "4": "Four",

                   "5": "Five",

                   "6": "Six",

                   "7": "Seven",

                   "8": "Eight",

                   "9": "Nine",

                   "10": "Ten"}

 

# Handle cases when 10 comes in input

if len(cardNotation) == 3:

 

   number = cardNotation[:2]

   color = cardNotation[2:]

   print cardNumberValues.get(number) + " of " + cardColors.get(color)

 

elif len(cardNotation) == 2:

 

   number = cardNotation[:1]

   color = cardNotation[1:]

   print cardNumberValues.get(number) + " of " + cardColors.get(color)

 

else:

   print "INVALID VALUE"

You might be interested in
How are the monsters related to humans
Brrunno [24]

Answer:

body features

Explanation:

8 0
3 years ago
5255555555555+55555555555555/1111*99442
Marina CMI [18]

Answer:

(502763134343429265 /101)

Explanation:

7 0
4 years ago
Read 2 more answers
How can these requirements be met? Universal Containers conduct evaluations of their sales reps using a custom object consisting
Rudik [331]

Answer:

The answer is B. Use a private sharing model granting record access using custom setting; manage field access with page layouts and field level security

Explanation:

The answer is B. Use a private sharing model granting record access using custom setting; manage field access with page layouts and field level security.

The reason the answer is B is because if access is provided through a hierarchy, it will give access to all the users at the higher manager role for the records of every executive. Also the options provided do not state clearly if Grant access using hierarchy is also checked so we cant assume that.

4 0
4 years ago
Which tab should you click if you want to access the Show All Comments option in a worksheet?
Lostsunrise [7]

Answer: Review

Because you want to review the comments

3 0
3 years ago
Read 2 more answers
Write python code that does the following.
Mariulka [41]

Answer:

the answers are in front of you it is correct to follow the steps

¯\_(ツ)_/¯:

5 0
3 years ago
Other questions:
  • Which of the following is not a standard method called as partof the JSP life cycle?
    5·1 answer
  • Jesse has finished typing an essay for her college assignment and submitted it. The next day she received an email from her prof
    15·2 answers
  • Extending the web server functionality implies that the web server and the web-to-database middleware will properly communicate
    10·1 answer
  • What does it mean to say that a graph is complete?
    14·1 answer
  • This function whose primary purpose is to display information to the user can only display one value at a time.
    15·1 answer
  • To create a new table by using a select statement, you code the ___________________________ clause.
    14·1 answer
  • What two benefits are a result of configuring a wireless mesh network? Check all that apply.
    12·1 answer
  • How to get the whole number of a fraction in python
    6·1 answer
  • Pls anyone answer this Resource sharing is the need of network because?
    15·1 answer
  • 1- Identify the face expressions is considered....
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!