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
BaLLatris [955]
3 years ago
8

Write a program that simulates picking a card from a deck of 52 cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6,

7, 8, 9, 10, Jack, Queen, King) and suit (Clubs, Diamonds, Hearts, Spades) of the card using python
Computers and Technology
1 answer:
Artyom0805 [142]3 years ago
7 0

Answer:

Explanation:

The following is a python function that has arrays with all the cards available and then uses random to choose a random card from the dictionary. Finally it prints out the card chosen...

import random

def choose_card():

   card = ["Ace", 2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen', 'King']

   symbols = ['Clubs', 'Diamonds', 'Hearts', 'Spades']

   chosen_card = str(card[random.randint(0, len(card))])

   symbols = symbols[random.randint(0, len(symbols))]

   print("Chosen Card: " + chosen_card + " of " + symbols)

You might be interested in
REOLVER EL SIGUIENTE PROBLEMA: R1=1.7K, R2=33K R3=4.7K R4=5.9K R5=17K IT=20mA CALCULAR: VT, I1, I2, I3, I4, I5 Y RT
Aneli [31]
Answer :

Ok

Step-by-Step Explanation:
7 0
3 years ago
Write the code for invoking a static method named sendTwo, provided by the DataTransmitter class. There are two arguments for th
MAVERICK [17]

Answer:

DataTransmitter.sendTwo(15.955, 13);

Explanation:

The code above will call the method sendTwo() which exists inside the class DataTransmitter

Because this a static method it can be invoked with only the dot operator without making an object of the DatTransmitter class with the new Operator

Since the method sendTwo () accepts two parameters of type double and int respectively, the values 5.955, 13 are passed as argument during the method call.

5 0
3 years ago
To create an instance of Big Decimal for 454.45, use ________.
agasfer [191]

Answer:

C.

Explanation:

Based on the Java documentation; when creating an instance of BigDecimal, we can pass a string as a constructor.

System.out.println(new BigDecimal("454.45"));

8 0
4 years ago
Wich is the correct process for selecting an entire row in a spreadsheet?
Eva8 [605]
CTRL - (select sentence) - ALT

6 0
3 years ago
………………….... controls the operations like reading data from input devices, transmitting information to output devices and checkin
katrin [286]

Explanation:

hi the IP address of my colleague of mine that

6 0
3 years ago
Other questions:
  • Array elements must be ________ before a binary search can be performed.
    8·1 answer
  • An assembly line is an example of which of the following facility layouts?
    8·1 answer
  • All ofthe following are correct EXCEPT one option when it comes towriting disappointing news letters. Identify theexception.
    6·1 answer
  • What should a system administrator use to disable access to a custom application for a group of users?
    5·1 answer
  • Suppose company A wants to develop a program that duplicates the functionality of a programm by company B. Describe how company
    8·1 answer
  • Assume that a finite number of resources of a single resource type must be managed. Processes may ask for a number of these reso
    10·1 answer
  • 30 POINTS !!!!!!!!
    12·1 answer
  • What type of address uses a number that uniquely identifies each computer?
    6·2 answers
  • Let A and B be two stations attempting to transmit on an Ethernet. Each has a steady queue of frames ready to send; A’s frames w
    7·1 answer
  • How does one skip videos on edgenuit
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!