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
What is Gamekit Loa3's all questsions
Stells [14]
Video games and currency premium playing
4 0
3 years ago
What kind of security features does Microsoft Security Analyzer promise?
Margaret [11]

Answer:

  • Microsoft security analyzer easily update the software system and it a free standalone component which basically provide security to many systems. We can easily update pure system once in a week.
  • Basically, it is a free independent segment which provide the security to many other frameworks. It is used to protect various number of windows against weak passwords by using security scanning.
  • It also check errors in the operating system and provide the security to the file system.
  • It is used to determine the state of security and other specific guidance.

8 0
2 years ago
Which of the following statements are true?
Mamont248 [21]

Answer:

The answer is: c. Adding external CSS is a good practice for various reasons, including code organization.

Explanation:

External CSS improves maintainability in code.  

Internal CSS has precedence over external CSS, it means that internal will overwrite external CSS, but abuse of internal CSS  often makes hard to maintain HTML code on a large website.

Furthermore, it is much easier to modify one CSS(external) file that can impact multiple web pages than go into every HTML page and modify your styles per page. Many sites have hundred or more pages, go through each one wouldn't be productive.

3 0
3 years ago
The process of executing a program is also called ________.
irga5000 [103]
It is also called running it.  Hope this helps!!!
5 0
3 years ago
It is easier to make an object move across the screen by using the tweening function rather than creating each individual frame
Vesna [10]
Uhhhh I believe it’s true if it’s wrong I’m srry ....
3 0
3 years ago
Other questions:
  • Get these points why they hot!!!!!!!!!!!!!!!!!!!!
    14·2 answers
  • Which form of investigation aims at checking whether or not a target system is subject to attack based on a database of tests, s
    15·1 answer
  • Write a pseudo-code that keeps asking the user for a given number 'n' different of zero, then print all numbers between one &amp
    8·1 answer
  • Match each type of software license with the appropriate definition.
    11·1 answer
  • A ________ is a self-contained program that spreads through a computer network by exploiting security holes in the computers con
    9·1 answer
  • What will you see on the next line?
    6·2 answers
  • Write 3 things that can't be done without technology. write your opinion?
    14·2 answers
  • Generally speaking, problems are rarely caused by motherboards. However, there are some instances in which a motherboard can fai
    12·1 answer
  • In an executing process, the program counter points __________.
    15·1 answer
  • Customer history is an example of what
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!