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
astraxan [27]
2 years ago
12

Write a program that keeps track of a simple inventory for a store. While there are still items left in the inventory, ask the u

ser how many items they would like to buy. Then print out how many are left in inventory after the purchase. You should use a while loop for this problem. A sample run is below.
(CodeHS, PYTHON)
Computers and Technology
2 answers:
neonofarm [45]2 years ago
4 0

Answer:

STARTING_ITEMS_IN_INVENTORY = 20

num_items = STARTING_ITEMS_IN_INVENTORY

# Enter your code here

while num_items > 0:

print("We have " + str(num_items) + " items in inventory")

toBuy = int(input("How many would you like to buy?"))

if toBuy > num_items:

print("There is not enough in inventory")

print("Now we have " + str(num_items) + " left")

else: # ok to sell

num_items = num_items - toBuy # update

if num_items > 0: # only for printing

print("Now we have " + str(num_items) + " left")

print("All out!")

Explanation:

This allows Python to store the number of items in inventory after each purchase by subtracting how much is bought with the toBuy function by how much is left. This continues until num_items is no longer greater than zero. If what’s toBuy goes above the # of items left in inventory, then the “if toBuy > num_items” segment of the code comes into play by telling the user there’s not enough and re telling them how much is left and how much they’d like to buy. When the items in inventory is out, meaning the exact amount that’s left is purchased, then Python prints “All out!”

MissTica2 years ago
3 0

Answer:no

Explanation:

You might be interested in
What is the software that provides the mechanisms to access a database called?
NeX [460]

Answer:

Database Management Software.

Explanation:

The software that provides  the mechanism to access the database is called  Database Management Software.There are two types databases  SQL  and  No SQL.There are various types of  database Management Software  present online for ex:-My SQL,Microsoft SQL server,Microsoft Access,Postgres SQL,Mongo DB etc.

3 0
3 years ago
You can set the margin using the rular also true or false​
Murljashka [212]

Answer:

true

Explanation:

7 0
2 years ago
A diagram of a flow chart to find the average of 10 numbers​
Nat2105 [25]

Answer:

Kindly check attached picture

Explanation:

Flowchart gives a graphical representation of a steps taken towers the execution of a program.

In the flowchart attached, A variable was initialized and set to 0 ; then a for loop was used to iterate integers 1 up to 10, for each number. It is added to the initialized variable sum until all the 10 integer numbers are added. The the average is obtained by dividing by 10.

4 0
2 years ago
What are some methods the researcher can use to avoid the impact of their recency bias?
dusya [7]

The methods that researcher do use to avoid the impact of their recency bias is that:

  • Option C. Record each interview that they conduct.
  • Option D. Take detailed notes during interviews.

<h3>What are some ways to lower the influence of bias when conducting user research?</h3>

The ways to lower the influence of bias when conducting user research include:

  • A person need to ask  open-ended questions. So not push people towards a given outcome.
  • Ask users to tell what is important to them.
  • Set your  objectively weight based on your findings.

Therefore, The methods that researcher do use to avoid the impact of their recency bias is that:

  • Option C. Record each interview that they conduct.
  • Option D. Take detailed notes during interviews.

Learn more about recency bias from

brainly.com/question/24491228

#SPJ4

See full question below

Consider the following scenario:

Imagine that a UX designer creates an app for saving, organizing, and streaming podcasts. To learn about user experiences with their product, the designer conducts interviews with a select group of target users: podcast enthusiasts. The researcher interviews 10 respondents and remembers the end of the last interview most clearly. The researcher uses this final interview to guide their thinking.

What are some methods the researcher can use to avoid the impact of their recency bias? Select all that apply.

A. Hire an outside research team to conduct the interviews

B. Survey large groups of people to supplement the interviews

C. Record each interview that they conduct

D. Take detailed notes during interviews

6 0
1 year ago
What is often used to improve the quality of a broadcast?
Karo-lina-s [1.5K]
The answer is relay station.
 Relay station is often used to improve the quality of a broadcast. It is an amplifier for restoring the strength of a transmitted signal. An amplifier is an electronic equipment that increases strength  of signals passing through it. Relay station has been known as America's Friendliest travel center.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Your browsing the Internet and realize your browser is not responding which of the following will allow you to immediately exit
    14·2 answers
  • What is WEB 1.0 to WEB3.0
    11·1 answer
  • Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed
    13·1 answer
  • In the digital age we have less time to absorb and make sense of new information
    12·2 answers
  • (9.10 Code Practice: Question 1)
    12·1 answer
  • What are the significances of blogs?
    7·2 answers
  • In the EXPLORE online library, the ratio of the number of novels to that of dictionaries is 2:3 and the total number of novels i
    9·1 answer
  • A network of computers that provides access to information on the web.
    15·2 answers
  • ANSWER QUICKLY!!! <br><br> Which aspect of planning is a preventive action?
    15·1 answer
  • If you try to add a new item to a full stack the resulting condition is called a(n)?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!