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
Instructions:Select the correct answer.
VladimirAG [237]

B. audio file is the answer

5 0
3 years ago
Read 2 more answers
When you're working with a word processing document and you press the DEL Key what happens
wariber [46]
<span>The character to the right of the cursor is deleted. </span>
4 0
3 years ago
Read 2 more answers
Harry needs to use a type of graph in a spreadsheet to show variations in data over a specific period. What type of graph or cha
stealth61 [152]
Bar graph!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5 0
3 years ago
Read 2 more answers
For a web application we associate a web server, for a mobile application we associate a mobile server. for a decentralized appl
Alex_Xolod [135]

For a decentralized software application we associate a blockchain server.

<h3>What is a server?</h3>

A server can be defined as a dedicated computer system that is designed and developed to provide specific services to other computer devices or programs, which are commonly referred to as the clients.

<h3>Types of server.</h3>

In Computer technology, there are different types of server and these include the following:

  • Web server
  • Email server
  • File server
  • Database server
  • Proxy server
  • Distributed communication server
  • Centralized Server
  • Distributed application server
  • Blockchain server

Generally, a web software application is associated with a web server, a mobile software application is associated with a mobile server, and a decentralized software application we associate a blockchain server.

Read more on web server here: brainly.com/question/27960093

#SPJ1

7 0
1 year ago
White lines
kykrilka [37]

Answer:

Its B                                                                                                                                            

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • What is an additional clock tab
    11·1 answer
  • How do I write code in Java for "A spinner for a game has four possible options: blue, red, yellow, green. The chance of landing
    10·1 answer
  • PLEASE HELP!<br> How do you "brainliest" an answer?
    13·2 answers
  • List the steps in setting up an online banking account
    12·2 answers
  • Suppose we are comparing the implementations of insertion sort and merge sort on the same machine(You don’t need to know the alg
    13·1 answer
  • What is the purpose of the domain name​
    5·1 answer
  • 3.19 LAB: Seasons In C++ Write a program that takes a date as input and outputs the date's season. The input is a string to repr
    15·1 answer
  • What keyword must be used on any method (function) on your class that is called from your main() method?
    15·1 answer
  • How is internet connection made possible.​
    7·1 answer
  • When using MakeCode Arcade, what is the easiest way to make modules?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!