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
8. _______ are used to store all the data in a database.
Neko [114]

C.forms is yo answer

8 0
4 years ago
Read 2 more answers
Write a function statement() that takes as input a list of floating-point numbers, with positive numbers representing deposits t
katrin2010 [14]

Answer:

def statement(numbers):

   deposits = []

   withdrawals = []

   for number in numbers:

       if number > 0:

           deposits.append(number)

       if number < 0:

           withdrawals.append(number)

   

   return [sum(deposits), sum(withdrawals)]

Explanation:

*The code is in Python.

Create a function called statement that takes numbers as a parameter

Inside the function, create two empty lists called deposits and withdrawals. Create a for loop that iterates through the numbers. Inside the loop, if a number is greater than 0, add it to the deposits. If a number is smaller than 0, add it to the withdrawals. When the loop is done, return the sum of the deposits and the sum of the withdrawals (use sum function to sum the numbers in the lists)

5 0
3 years ago
Which of these statements best describes an application programming interface?
TiliK225 [7]
<span>It is a set of commands, provided by the manufacturer of an operating system, which allows programmers to create applications.</span>
5 0
3 years ago
What is the need for using secondary memory devices?
Savatey [412]
Hi pupil here's your answer ::


➡➡➡➡➡➡➡➡➡➡➡➡➡

They are needed because of the following reasons :

》The storage capacity of primary memory is limited.

》 Primary memory (RAM) is volatile in nature.

》 RAM is not portable memory.

》 RAM chips are expensive. Increasing RAM will increase the price of the computer.

So, for the above reasons we need to use the Secondary memory devices.

⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅


Hope this helps . . . . .
7 0
3 years ago
Hot five was the famous band of which musician?
slega [8]
Hot Five was Louis Armstrong's first recording jazz band.
4 0
4 years ago
Other questions:
  • How do you train a computer to recognize your voice?
    14·2 answers
  • Which phrase best defines communication​
    9·1 answer
  • Write a javascript program that reads three integers named start, end, and divisor from three textfields. your program must outp
    6·2 answers
  • 50 POINTS &amp; A FOLLOW!
    11·2 answers
  • A quien se le conoce como el padre de la tecnologia?
    10·1 answer
  • have a folder on your Windows computer that you would like to share with members of your development team. Users should be able
    9·1 answer
  • How do you think Beyoncé choreography has/will influence the future of dance?
    9·2 answers
  • Which of the following statements describes the general idea of an assistive media​
    7·1 answer
  • MODERATOR DELETE MY ACC
    8·2 answers
  • (isc)² certified information systems security professional official study guide 6th editionauthors: stewart, james michael; chap
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!