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
Which font attribute would be most appropriate to make a papers heading stand out?
eimsori [14]

If you want your heading to pop out I would go for bold Becuase it shows the letters darker and bigger which would make the heading the center of attention.

7 0
3 years ago
Read 2 more answers
I just want to say thanlouy for all the branlies on this app
Gnom [1K]

Answer:

that's just what we do :D

Explanation: because we're awesome UvU

7 0
3 years ago
PLEASE HELP!!!!!
Allushta [10]

Answer:

Insert

Explanation:

Insert

7 0
3 years ago
Read 2 more answers
What was his beliefs?
Citrus2011 [14]

A belief is an attitude that something is the case, or that some proposition about the world is true.[1] In epistemology, philosophers use the term "belief" to refer to attitudes about the world which can be either true or false.[2] To believe something is to take it to be true; for instance, to believe that snow is white is comparable to accepting the truth of the proposition "snow is white". However, holding a belief does not require active introspection. For example, few carefully consider whether or not the sun will rise tomorrow, simply assuming that it will. Moreover, beliefs need not be occurrent (e.g. a person actively thinking "snow is white"), but can instead be dispositional (e.g. a person who if asked about the color of snow would assert "snow is white").[2]

There are various different ways that contemporary philosophers have tried to describe beliefs, including as representations of ways that the world could be (Jerry Fodor), as dispositions to act as if certain things are true (Roderick Chisholm), as interpretive schemes for making sense of someone's actions (Daniel Dennett and Donald Davidson), or as mental states that fill a particular function (Hilary Putnam).[2] Some have also attempted to offer significant revisions to our notion of belief, including eliminativists about belief who argue that there is no phenomenon in the natural world which corresponds to our folk psychological concept of belief (Paul Churchland) and formal epistemologists who aim to replace our bivalent notion of belief ("either we have a belief or we don't have a belief") with the more permissive, probabilistic notion of credence ("there is an entire spectrum of degrees of belief, not a simple dichotomy between belief and non-belief").[2][3]

Beliefs are the subject of various important philosophical debates. Notable examples include: "What is the rational way to revise one's beliefs when presented with various sorts of evidence?"; "Is the content of our beliefs entirely determined by our mental states, or do the relevant facts have any bearing on our beliefs (e.g. if I believe that I'm holding a glass of water, is the non-mental fact that water is H2O part of the content of that belief)?"; "How fine-grained or coarse-grained are our beliefs?"; and "Must it be possible for a belief to be expressible in language, or are there non-linguistic beliefs?".[2]

4 0
3 years ago
What is an idea for novel food production technologies or systems that require minimal resources and produce minimal waste, whil
Luden [163]

Answer:

Dehydrated food that is vacuumed sealed.

Explanation:

Dehydrated food is not hard to make and holds the nutritious values needed for a human to survive. Dehydrated food can last up to 1-2 years if vacuumed sealed.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Ben works at a top accounting firm in Salt Lake City and his responsibilities include developing individual and departmental goa
    9·1 answer
  • The desktops of computers running the same OS all look the same
    8·1 answer
  • Jim is expecting a very busy weekend at his store, so he sent the following e-mail to his employees: ALL EMPLOYEES MUST WORK THI
    6·1 answer
  • After installing the processor, if the system begins the boot process and suddenly turns off before completing the boot, the pro
    14·1 answer
  • let's imagine you're searching for hotels in searching chicago, what should you search for in order to get the most relevant res
    11·1 answer
  • Please help me very important
    7·1 answer
  • 3. Radheshree has to complete her assignment and submit it on the next day. While typing
    9·1 answer
  • What do you mean by Graphics editing​
    14·1 answer
  • Bank Account Postings While reviewing your checking account balance online, you notice that debit card purchases have not posted
    5·1 answer
  • If a robot is able to change its own trajectory as per the external conditions, then the robot is considered as the__.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!