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

Write out code for a nested if statement that allows a user to enter in a product name, store the product into a variable called

product_name and checks to see if that product exists in your nested if statement. You must include 5 product names to search for. If it is then assign the price of the item to a variable called amount and then print the product name and the cost of the product to the console. If it does not find any of the items in the nested if statement, then print that item cannot be found.
Computers and Technology
1 answer:
OlgaM077 [116]3 years ago
6 0

Answer:

product_name = input("Enter product name : ")

if product_name=="pen"or"book"or"box"or"pencil"or"eraser":

   if product_name == "pen":  

       amount = 10

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "book":

       amount = 100

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "box":  

       amount = 150

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "pencil":  

       amount = 5

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

   if product_name == "eraser":

       amount = 8

       print(f"Product Name: {product_name}\nCost: {amount} rupees")

else:  

   print("Item not found!")

Explanation:

The python program is a code of nested if-statements that compares the input string to five items of the first if-statement. For every item found, its code block is executed.

You might be interested in
Maria is starting a pet hotel and needs a website to promote her business and establish her brand. Which of the following is the
german

<em>The answer is </em><em>C. Maria should use turnkey solution that will allow her to use templates and management tools to create a site. </em>

<em> </em>

<em>Turnkey solution</em><em> is a type of business solution that can allow business owners to use these ready-made tools, templates and system to their existing process and business operations. Such tools include </em><em>CRM </em><em>and websites. For example, you are in need of a Loans Management System, that must be implemented next week. You can browse for Loans CRM that are widely available on the internet, subscribe to the service, make payment and this could be used right away in your business operation. Same thing with Maria's needs on the website. She could just subscribe to a website that can allow her to create pages and links with drag and drop and make it running right away.</em>

8 0
3 years ago
What is output by the following code? for x in range(7, 16): print(x * 2, end=" ") Group of answer choices 14 16 18 20 22 24 26
madreJ [45]

Input:-

\tt for\:x\:in\:range(7,16):

\tt print(x*2,end"")

Output:-

\tt 14,16,18,22,24,26,28,30,32

The loop will start from 7×2=14 to 16×2=32

8 0
3 years ago
What device makes it possible for multiple customers to share one address
Galina-37 [17]
A=NAT is correct I think
6 0
3 years ago
During class, your professor mentions an interesting article about Obama's networking in Iowa. From the Library homepage's list
jenyasd209 [6]

Answer:

True.

Explanation:

At the time of attending the class, the professor discusses an informative article regarding Iowa's networking with Obama. From those in the collection of Publications Indexes and Databases (References to an external site) of it's Libraries webpage, identify and scan the Sociological Analyses index using such terms: Political networking and Iowa to identify an article in Feb 2010.

Thus, topic words are helpful to identify related articles on the topic for students. Internet is the reference used for this article.

4 0
3 years ago
Suppose that actions can have arbitrarily large negative costs; explain why this possibility would force any optimal algorithm t
yuradex [85]

The reason why this cost is going to force the optimal algorithm to explore the entire state space is the fact that large negative costs can cause concurrent automatically for optimal solutions.

<h3>The step to take with a negative cost</h3>

Now if there is the existence of a large negative cost for each of these actions, the optimal algorithm is going to try an exploration of the whole space state.

The reason for this would be the fact that the route that has the least consequences would be better of.

Read more on negative cost here: brainly.com/question/7143854

3 0
3 years ago
Other questions:
  • By apply styles, _____________ formats are being applied each time.
    6·1 answer
  • Which statement about information published on the internet is true?
    9·2 answers
  • How can utility poles be eliminated as roadside hazards
    9·1 answer
  • What makes up an HTML element?
    12·2 answers
  • Binary tree algorithm?
    5·1 answer
  • Here's another question!<br><br> What is some iterative programming structure uses?
    13·1 answer
  • ___________ is a technique that uses IT to develop an ongoing relationship with the purchasers or buyers of an organization's pr
    13·1 answer
  • Six security issues and six descriptions are shown below.
    11·1 answer
  • I cant tell if tubbo is a bee or a goat <br>or could he be human in the smp
    12·1 answer
  • Sharing private information causing a person to be humiliated is considered to be doxing. T or F
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!