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]
2 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]2 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
The picture that graphically since the items you use in windows is called
katrin2010 [14]
Flip board or in some cases it is called a life at a glance
5 0
3 years ago
A type of storage which holds data on a permanent basis for later use<br><br><br><br> Help please
nikdorinn [45]

Answer:

Permanent storage, also called persistent storage, is any computer data storage device that retains its data when the device is unpowered. A common example of permanent storage is the computer's hard drive or SSD.

Explanation:

4 0
3 years ago
4. An abstract data type is defined as _____.
marusya05 [52]

Answer: object that persist set of values and operations as behavior

Explanation: Abstract data types(ADT)are those object value which are dependent upon the collection of the values and collection of the operations.The organization of the data object is not specified in ADT but the operations that are to be carried out are defined in it.

The implementation individuality displayed by the ADT and hiding of the representation or design makes it abstract.

8 0
3 years ago
Host A sends a packet of length 1,100 bytes to host B over a link with transmission rate 4 Mbps over a distance 1300 km, propaga
ArbitrLikvidat [17]

Answer:

please mark me brainlist

Explanation:

6 0
3 years ago
What is the output for the following program?
Lelu [443]

Answer:

Output:

15

20

25

Explanation:

In first iteration value of num is 10. Condition is checked 10 is less than 21 so value of num is incremented by 5 and value 15 is printed than again condition is checked 15<21 so value of num is incremented again and 20 is printed. Again condition is checked 20<21. So 25 is printed. Then 4th time when condition is checked vakue of num is 25 and while loop condition becomes false because 25 is not less than 21 and program is terminated here.

6 0
2 years ago
Other questions:
  • What is microsoft excel
    12·1 answer
  • In these weeks readings, we learned about the CIA Triad and how each exhibits dependence on the other. Give examples of how fail
    12·1 answer
  • ________ gives its approval to U.S. e-commerce websites that follow strict privacy standards, such as explaining to visitors how
    6·1 answer
  • Motorcycles have two or three wheels, a seat for the rider and at least a ____ horse-powered engine.
    15·1 answer
  • What is the definition of D1-D4?
    14·1 answer
  • Which diagram is used as a popular technique for investigating causes and effects? 1. Cause and effect 2. Fishbone/lshikawa 3. R
    13·1 answer
  • If a client is found _________ the NAP will attempt to make it _______. Group of answer choices A. non-compliant, compliant B. s
    13·2 answers
  • The costs incurred when a firm buys on the marketplace what it cannot make itself are referred to as
    6·1 answer
  • Please answer quickly :S
    7·2 answers
  • Who addicted to fnaf
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!