What's wrong with my program? Here is my code , if the user wants a 3rd card dealt they, have to select yes and the total will be for 3 cards. If they don't, then the total is for 2 cards.? I also need to print the total for both the dealer and the user and determine the winner of the game?


# import random
import random
def main():
# greet the user
print("Hello! Welcome to my card game!")
# deal the user a random card between 1 and 10
num1 = random.randint(1,10)
print("You drew a", num1)
# deal the user another random card (between 1 and two)
num2 = random.randint(1,10)
print("You drew a", num2)
num3 = random.randint(1,10)

# deal the user a third card?
again = input("Would you like to draw a 3rd card? Y or N? ")
d_total = random.randint(10,21)
u_total = (num1) + (num2) + (num3)
u_total1 = (num1) + (num2)
if again == "Y" or "y":

print("You drew a", num3)


if (u_total > d_total) and (u_total < 21):
# the user wins
print("Congratulations! You won!")
print("You drew a",num1,",", "a",num2,"," "and a",num3, "for a total of",u_total)
if again == "N" or "n":
print("You drew a", num1,"and a",num2, "for a total of",u_total1)


if (u_total > d_total) and (u_total < 21):


print("The dealer's total is", d_total)




else:

print("Sorry! You lose.")

main()

Answers

Answer 1

Your issue is on line 19 in your if statement. In python, if you have more than one condition in an if statement, you have to explicitly mention it after the or.

Your if statement is

if again == "Y" or "y":

However, this will always return true because the second statement simply asks "y".

To correct this, simply change the if statement to:

if again == "Y" or again == "y":

This will correct your code.

Another thing to consider is to always convert a userinput (whenever possible) to one version, this can be accomplished in your code by converting "again" into one version by using the .lower function.

again = input("Would you like to draw a 3rd card? Y or N? ")

again = again.lower()

Hope this helps!


Related Questions

Maze must establish a communication channel between two data centers. After conducting a study, she came up with the idea of establishing a wired connection between them since they have to communicate in unencrypted form. Considering the security requirements, Maze proposed using an alarmed carrier PDS over a hardened carrier PDS. Why would Maze make this suggestion in her proposal

Answers

Maze makes this suggestion in her proposal because the alarmed carrier PDS is because it offers continuous monitoring and less periodic visual inspections.

What is Protected distribution system?

This is a carrier system which is used in communication network environment for detection of the presence of a physical intruder.

The alarmed carrier PDS is preferably used as a result of it offering high level of security without periodic visual inspections.

Read more about Protected distribution system here https://brainly.com/question/10619436

Which term refers to the data stored in computer memory on which the processor applies the program instructions?

Answers

Answer:

Cache memory

Explanation:

Cache memory is a small unit of ultrafast memory built into the processor that stores frequently or recently accessed program instructions and data. 

what are the examples of computer software​

Answers

Answer:

Explanation:

Examples:

System softwareapplication softwareregistry cleanersoperating systems

Question 2 of 10
A company is looking for an employee to find new opportunities for improving
its systems by examining existing data. Which computer field includes this
job?
A. Security analysis
B. Systems analysis
C. Network support
D. Hardware design
SUBMIT

Answers

Answer:

B. Systems analysis

Explanation:

A company is looking for an employee to find new opportunities for improving

its systems by examining existing data.

The field that includes finding new opportunities for improving its systems by examining existing data is system analysis.

The correct option is B .

Given, scenario of a company.

The computer field that includes a job to find new opportunities for improving systems by examining existing data is Systems Analysis.

Systems analysis is the process of examining an organization's business processes and information systems to identify and implement improvements. It involves analyzing data and information flow, identifying areas of inefficiency, and developing and implementing solutions to improve system performance and productivity.

Therefore, option B is the correct answer.

Know more about system analysis,

https://brainly.com/question/32477593

#SPJ3

You copy a paragraph from an article and put it into a paper you are writing as if you had written the paragraph yourself. This is an example of: Ophishing O identity theft. O augmenting reality. O plagiarism.​

Answers

Copying a paragraph from an article into a paper you are writing as if you had written the paragraph is an example of: D. plagiarism.​

What is plagiarism?

Plagiarism can be defined as the act of representing or using an author's literary work, thoughts, ideas, language, or expressions without their consent, acknowledgement or authorization.

This ultimately implies that, plagiarism is an illegal act that involves using another author's intellectual work or copyrighted items word for word without getting an authorization or permission from the original author.

In conclusion, copying a paragraph from an article into a paper you are writing as if you had written the paragraph is an example of plagiarism.​

Read more on plagiarism here: https://brainly.com/question/397668

ABC Manufacturing Company is located in Hiroshima, Japan. Being prone to earthquakes, the company decided to implement a backup of their data on a Singapore server. The IT administrator contacted you to identify the optimal command interface protocol for this backup. Which command interface protocol should you advise?

Answers

The command interface protocol that I would suggest to the IT administrator is Secure Shell (SSH).

What is a command interface protocol?

A command interface protocol can be defined as a standard protocol that is designed and developed to processes commands in the form of lines of text to a software program that is installed on a computer system.

The types of command interface protocol.

In Computer technology, there are different types of command interface protocol and these include:

SSLTLSSSH

SSH is an acronym for Secure Shell and it is a standard network protocol that gives a IT administrator a secure way to access data over an unsecured network, especially when backing up data.

Read more on SSH here: brainly.com/question/17147683

why is the computer uses binary why not trinary?​

Answers

Explanation:

because they only function with that one the gates also prevent it from being able to use it

please help me please please

Answers

The light is shining on the left side of his face because the shadow is on the other side

what is computer hardware / software​

Answers

Answer: Computer hardware is any physical device used in or with your machine, like for example, a mouse, or a keyboard. Computer software is a collection of programming code installed on your computer's hard drive it can process billions of data and inputs through this.

Hope this helps!

What instructions would a computer have the hardest time completing correctly

Answers

The instructions which a computer would have the hardest time completing correctly are complex instructions.

What is an instruction?

An instruction can be defined as a set of executable codes that are written and developed to instruct the central processing unit (CPU) of a computer system on how to perform a specific task and proffer solutions to a particular problem.

This ultimately implies that, it is a segment of executable codes which contain steps that are to be executed by the central processing unit (CPU) of a computer system.

In Computer programming, the instructions which a computer would have the hardest time completing correctly are complex instructions.

Read more on instructions here: https://brainly.com/question/26324021

Sumit has created a procedure to draw a boat in Logo and saved it by the name, 'Boat'. Next day, when he tried to type the name 'Boat', the computer displayed the message "I don't know how to Boat". Why has it happened?​

Answers

The computer couldn't draw a boat because the "Boat command" has been deleted.

What is an algorithm?

An algorithm can be defined as a standard formula (procedures) which comprises a set of finite steps and instructions that is designed and developed to solve a problem on a computer under the appropriate conditions.

This ultimately implies that, an algorithm is a standard, logical formula (procedures) containing the step-by-step rules and instructions for performing a specific task on a computer system such as drawing a boat in Logo.

In this scenario, the algorithm created by Sumit on his computer couldn't draw a boat because the "Boat command" has been deleted from the computer system.

Read more on algorithm here: brainly.com/question/24793921

.
Derrick is having trouble figuring out why his computer monitor's image is distorted. He has exhausted all of the troubleshooting ideas he can think of and has decided to contact the customer support number for his device. The Technical Support Specialist tells him that he can fix the problem but will need remote access to his computer. Remote access refers to:

using a remote control like your television has to control your device.

taking control of the operation of a computer without physically using it.

allowing someone from a remote location to come and provide in-home service on your computer.

buying a remote control peripheral and installing it on your computer.

Answers

Answer:

I think it's the second option.

Explanation:

Definitely not the first or last choice.

Low Level Programming Language is also known as:

(A) Object Oriented Language
(B) Procedural Oriented Language
(C) Machine Level Language
(D) Processor Level Language​

Answers

Machine level language

Why might preparing taxes be different for people living in different states?
A. Everyone must file taxes but depending on where you live, you may not need to file federal taxes.

B. States taxes are due January 1st but federal taxes are due April 15th.

C. It’s not different. All states have the same tax laws.

D. Everyone must file federal taxes, but each state has different Tax laws.

Answers

The act of preparing taxes be different for people living in different states because Everyone must file state taxes but depending on where you live, you may not need to file federal taxes.

What is the reason for taxing the people?

Taxes are known to be a primary source of revenue that is made by the governments. This is known also to be the money that  is spent to develop and maintain public infrastructure.

It is said to be one that differs from place to place roads we travel on, and the act of preparing taxes is said to be different for people living in different states due to the fact that  all must file state taxes but based on where you live.

Learn more about taxes  from

https://brainly.com/question/25825000

1. provides a list of at least five SSIDs and the
corresponding wireless encryption protocol.


2. identifies their SSID and encryption protocol.
Student provides a list of at least five SSIDs and the
corresponding wireless encryption protocol.


2. Student identifies their SSID and encryption protocol.

Answers

One of the most important ways to provide wireless security is through:

The use of encryption.

What is Wireless Security?

This refers to the network authentication and use of encryption to secure a network from unauthorized access or compromise of the network by an external agent.

With this in mind, we can see that SSID is a WiFi network name and it makes use of WPA2 security encryption to protect the wireless network through wireless encryption protocol.

Please note that your question is incomplete so I gave you a general overview to help you get a better understanding of the concept.

Read more about wireless security here:
https://brainly.com/question/14449935

Question 3 (1 point)
an assortment or set of type or characters all of one style and sometimes one size.
italic
O underline
font
Obold

Answers

an assortment or set of type or charactera all of one style and sometimes one size. Ans: italic

why it is important to know the computer hardware and software​

Answers

Answer:swer:

it makes no sense



Explanation:

Answer:

1) to earn a living

2) to added knowledge

3) to contribute positively to the technological aspect of the world.

Explanation:

1) one could earn a living as a teacher or a computer vendor or even a softwware engineer.

2) if one understand the computer, he could work system for families and friends

8. SQL, Oracle Report, and Visual Basic are all examples under the
generation
A. First Generation
B. Second Generation
C. Third Generation
D. Fourth Generation

Answers

SQL, Oracle Report, and Visual Basic are all examples under the generation.

Fourth generation languages

Fourth-generation programming language (4GL) are computer programming language based on the advancement on third-generation programming languages (3GL).

4GLs may include support for database management, report generation, mathematical optimization, GUI development, web development.

SQL, Oracle Report, and Visual Basic are all examples under the generation.

Find out more on Fourth generation languages at: https://brainly.com/question/9325849

ways of caring for storage devices​

Answers

Answer:

eject the device before removing

Explanation:

If you just unplug a device, you run the risk of unplugging while an application is still using the device

Who is known as Mecile Man of India?​

Answers

Answer:

D A.P.J. Abdul Kalam. Dr. A.P.J Abdul Kalam was the 11th President of India. His work with the Defence Research and Development Organisation in developing military equipment like missiles and a civilian space programme earned him the title of Missile Man of India.

Answer:

APJ Abdul Kalam Birth Anniversary 2021: Missile Man of India's 10 Major Contributions to the Country.

What are two possible challenges of online collaboration?
I A. The lighting for certain team members may be dim.
A B. Team members in different time zones may have difficulty
showing up to meetings.
C. Working on the project can become drawn-out and boring.
D. A slow internet connection can make it difficult to communicate
and access online tools.

Answers

Answer:

B. Team members in different time zones may have difficulty showing up to meetings.

&

D. A slow internet connection can make it difficult to communicate and access online tools.

Explanation:

Working remotely allows for people to collaborate from virtually anywhere, but different time zones could negatively impact the work flow due to drastic differences in time.

In addition, technical difficulties are another issue to keep in mind because of the virtual setting you're working in.

Answer:

B. Team members in different time zones may have difficulty

showing up to meetings.

D. A slow internet connection can make it difficult to communicate

and access online tools.

Explanation:

What's the latest tech​

Answers

Answer:

1. Artificial Intelligence and Machine Learning

2. Data Science

3. Full Stack Development

4. Robotic Process Automation

5. Edge Computing

6. Virtual Reality and Augmented Reality

7. Blockchain

8. 5G

9. Cyber Security

10. Quantum Computing

11. Internet of Things

12. Big Data Analytics

13. Human Augmentation

14. Everything-as-a-Service(XaaS)

15. DevSecOps

16. Predictive & Personalised Medicine

17. Voice Search Technology

18. Drones and Unmanned Vehicles

19. Mass personalization and Micro-Moments.

20. Genomics and Gene Editing

Answer:

artificial intelligence

In the five C's, how is cost different from price?
A. It includes the company's operating costs.
B. It makes it easier to promote the product.
C. It reduces the company's operating expenses.
D. It includes all of the costs related to the product.
Please select the best answer from the choices provided
А
B
Ο Ο Ο Ο
С
OD

Answers

Answer:

D

Explanation:

Well you cost is the opposite meaning of price

Option D It includes all of the costs related to the product is cost different from price.

What are five C's while the product is priced?

1. Cost - While pricing the product, the product price should contain all the costs interconnected to the product exists marketing, selling and distribution, and another cost.

2. Customers - Whether the customer will be capable to pay the price and exists the best judge.

3. Channels of distribution - Through which method it will reach its customers

4. Competition - which exists the competitors in the market and at what price the product stands sold by them.

5. Compatibility - Pricing stands to be done based on how much the product exists compatible with its supplement products.

Hence, Option D It includes all of the costs related to the product is cost different from price.

To learn more about product pricing refer to:

https://brainly.com/question/27432513

#SPJ2

Calculate the time complexity for the following function in terms of Big O notation. Explain your answer.
[Note: Line numbers are only for reference purpose]

int fun(int n)
{
1 int count = 0;
2 for (int i = n; i >= 0; i /= 2)
3 count += i;
4 for (int j = 0; j < n; j++)
5 count +=j;
6 return count;
}

Answers

Answer: It is 1 int count = 0;

2 for (int i = n; i >= 0; i /= 2)

3 count += i;

4 for (int j = 0; j < n; j++)

5 count +=j;

6 return count;

SO it is j(0-(-n)

Explanation: Im dum

df -h shows there is space available but you are still not able to write files to the folder. What could be the issue

Answers

The possible issue when df-h shows that there is space available is that;

It Ran out of inodes

What is a Linux System?

The correct reason is that it ran out of nodes in Ubuntu which is an open source operating system on Linux

Now,  In a "vanilla" installation, if you have too many small files, they can consume inodes, but not space. However, you will observe that you have available space, but since your inodes are full, you'll not be able to use this space.

Read more about Linux System at; https://brainly.com/question/25480553

basics of visual basic

Answers

Visual Basic (VB) is an object-oriented programming language, and it supports the concepts of encapsulation, abstraction, polymorphism, etc. In VB, all the variables, methods, and application entry points are encapsulated within the class definition
Visual Basic (VB) is an object-oriented programming language, and it supports the concepts of encapsulation, abstraction, polymorphism, etc. In VB, all the variables, methods, and application entry points are encapsulated within the class definitions.

How to make a Java GUI application? Discuss each step needed.

Answers

Explanation:

Create a JFrame container

1- In the Projects window, right-click the NumberAddition node and choose New > Other .

2- In the New File dialog box, choose the Swing GUI Forms category and the JFrame Form file type. Click Next.

3- Enter NumberAdditionUI as the class name.

4- Enter my. numberaddition as the package.

5- Click Finish.

ILL GIVE BRAINLIEST
What are the pro and cons of digital news?

Answers

Answer:

pro is a

and cons are c

Explanation:

hope this helps you on digital news

Pros: Easier to spread urgent news, eco friendly, more variety
Cons: Easier to spread fake news

You have been hired at Maria's Kitchen, a restaurant in Riverside. Chef and owner Maria has
been asking her wait staff to take orders on paper. She would like a new system where the
wait staff can type in orders. The system should also print tickets for the kitchen staff that are
easy to read so they know what dish to make and what table it belongs to
For those of you who have food service experience, you will recognize this as a very simple
point-of-sale (POS) and kitchen display system (KDS). Learn more about POS and KDS here.
Industry note: real systems tie into the restaurant's financial and accounting records for
auditing (finance and accounting majors), automatically reorder supplies and ingredients at
the right time (supply chain majors), and allow access from a dashboard that can analyze the
data for patterns and trends as well as employee performance (management, marketing, and
business analytics majors).

Answers

A  new system where the wait staff can type in orders is known as waiter ordering system.

What is a waiter ordering system?

A waiter ordering system is known to be a kind of system that has been made a lot easy for the employees to take in online orders through the use of a tablet or iPad or a desktop system.

Using customers notion of what it means, it is a form of  online food ordering system that make sure that there is a very fast order-placement procedures. It is very useful for employees of restaurants, etc. as a waiter ordering system will help them to have a better work structure.

Learn more about waiter ordering system from

https://brainly.com/question/12827436

Write a Java Program
Specific Instructions

Create a class for the following object.

Deck - contains 52 cards initially. Each card is represented by an unchangeable suit and value.
Suits - ♣ (Club), ♠ (Spade), ♥ (Heart), ♦ (Diamond)
Values - 1(A),2,3,4,5,6,7,8,9,10,11(J),12(Q),13(K)

Actions

draw - retrieves the top most card on the deck. When called with number of desired cards, it will try to draw the N cards, if not enough, draw all cards.
shuffle - randomizes the location of all cards, excluding the drawn cards
restore - returns the last N cards drawn on the bottom of the deck, if no number is provided, return all drawn cards.
Make sure that the class is encapsulated.

Answers

In the Deck Builder, initialize the 52 cards (along with the 4 jokers, which should be called “wild” and the suit is “wild”).

Public class Deck

  private final List<Carta> Deck;

  public Baralho() {

      listaCartas = new ArrayList<>();

      String[] naipes = {"club", "spade", "heart", "diamond"};

      int pos = 0;

      Carta c;

With this code we will be able to create the Deck, initialize the 52 cards together with the 4 jokers.

Learn more about Deck in brainly.com/question/1660537

Other Questions
Why was there a sharp increase in the number of women in the workforce in 1945?. please anyone who knows What is the solid that forms when a solution starts to freeze. ILL GIVE 50 POINTS FOR GOOD ANSWER. 92 8/9 - 43 5/6 Enter your answer in the box as a mixed number in simplest form.Pls, help me If you do your best! What is the value of x Penny gives 1/5 of her earnings to charity. If she earns $90, how much will she give to charity? Round to the nearest penny. Including a quote from a govemment official in a story about tax cuts adds what to your story? A. Credibility B. Variety C. Connection with the audience D. All of the above "The trees were soldiers marching along the drive" is--a metaphora similealliterationrhyme Choose the correct completion for each of the following sentences.A tout aO mercio l'heureO No answer text provided.O demain Write the ratio of 15 pencils to 2 erasers in simplest form. 16.5 is 12% of what number? Which sentence is most clearly from a critique?A. In an interview, I asked the author his opinion on the increasingreliance on phones.B. "Cybersecurity is an incredibly fast-growing field," the author statesin chapter 2.O C. The concluding chapter of the book is the darkest one yet, paintinga bleak future.D. The author's arguments are often built on shaky ideas that need tobe fleshed out. Organisms that can grow with or without oxygen present are. A line passes through the points (-3,4) and (-8,14). Find this lines slope. If the slope does not exist, you may enter DNE or NONE. PLS HELP ILL GIVE BRAINLIEST! The sales tax on a $120 bill is 7.25%. After a coupon discount of 10% off the total cost with tax, what was the final amount of the bill? The fence around a rectangular horse ranch is 450 m long. If the ranch is 80 m wide, fine its area.Who will give me correct answer I will make him/her Brainlistest. Which ones are linear functions and why Why does the sum of -4 and 3 complain more than the sum of -3 and 5?(Before you answer this please note that this is a joke! The answer would be "It's the _ _ _ _ _ _ _ _ _ _ _!" The 11 missing letters include -EIENGEOVANT- Thank you in advance for your help! Answer this following equation. What's 2 + 10/10?