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 the function of ctrl+Q​
vlabodo [156]

Answer:

Ctrl+Q is used to remove a paragraph's formatting

Explanation:

Hope that's the answer you're looking for!

5 0
2 years ago
Write the application of computer in education and communication​
daser333 [38]

Answer:

Technology has profoundly changed education in many ways. Technology has greatly expanded access to education. In medieval times, books were rare and only an elite few had access to educational opportunities. Individuals had to travel to centers of learning to get an education. Today, massive amounts of information (books, audio, images, videos) are available at one’s fingertips through the Internet, and opportunities for formal learning are available online worldwide through online learning, podcasts, traditional online degree programs, and more. Access to learning opportunities today is unprecedented in scope thanks to technology.

Technology is a gift of God. After the gift of life, it is perhaps the greatest of God's gifts. It is the mother of civilizations, of arts, and sciences. Technology has certainly changed the way we live. It has impacted different facets of life and redefined living. Undoubtedly, technology plays an important role in every sphere of life. Several manual tasks can be automated, thanks to technology. Also, many complex and critical processes can be carried out with ease and greater efficiency with the help of modern technology. Thanks to the application of technology, living has changed and it has changed for the better. Technology has revolutionized the field of education. The importance of technology in schools cannot be ignored. In fact, with the onset of computers in education, it has become easier for teachers to impart knowledge and for students to acquire it. The use of technology has made the process of teaching and learning all the more enjoyable.

Technology has also begun to change the roles of teachers and learners. In the traditional classroom, the teacher is the primary source of information, and the learners passively receive it. This model of the teacher as the “sage on the stage” has been in education for a long time, and it is still very much in evidence today. However, because of the access to information and educational opportunity that technology has enabled, in many classrooms today we see the teacher’s role shifting to the “guide on the side” as students take more responsibility for their learning using technology to gather relevant information. Schools and universities across the country are beginning to redesign learning spaces to enable this new model of education, foster more interaction and small group work, and use technology as an enabler.

Explanation:

7 0
2 years ago
Which social networking site became a gaming platform after 2009
PtichkaEL [24]

Answer:

Should be Hi5

have good day

3 0
3 years ago
These are templates or patterns that make it easier for users to enter data
kupik [55]

Answer:

A piece of code

Explanation:

8 0
2 years ago
Identity any five system unit components and explain the use for each [apart from processor]<br>​
saw5 [17]

Answer:

RAM

ROM

PROCESSOR

MOTHER BOARD

HARD DISK

Explanation:

Random access memory or RAM store data temporary

Read only memory or ROM permanently store data and have a programming needed to start (PCs) or other electronic device

CPU or processor refers to brain of computer

Mother board the main internal hardware component of system unit

Hard disk is electro mechanical data storage

8 0
2 years ago
Other questions:
  • The system administrator in your office quits unexpectedly in the middle of the day. It's quickly apparent that he changed the s
    10·1 answer
  • Write a memo to the vice president, outlining the steps an employee might have taken to create an e-mail message and make it app
    15·1 answer
  • Productivity can best be described as:
    5·2 answers
  • Drag each tile to the correct box.
    9·1 answer
  • Your classmate is frustrated because the code that was designed to add up her five quiz grades is not working properly.
    12·1 answer
  • Fill this blanks with the given words​
    6·1 answer
  • Your program will be used by many departments at the university. Your comments will be important to their IT people. What would
    15·1 answer
  • THis took FOREVER! please go check it out, if you have seen my demo to this game, you will like the full version! https://scratc
    9·2 answers
  • How do you convert an algorithm to make it possible for a computer to read
    6·1 answer
  • How to create create a database in mysql using clv files
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!