Create a very simple grocery list script

Assignment Help Python Programming
Reference no: EM132236346

Project - Grocery List

Introduction - Your task for this project is to create a very simple grocery list script. This script also emphasizes the importance of using lists, dictionaries and loop types within your script and how the use of those functions shapes your approach in creating a script.

The task is broken down into three sections:

1. User Input

2. Loop through the grocery list

3. Provide output to the console

Data Structure - The structure of the data for this project is extremely important.

Each grocery item is a dictionary with the following key-value pairs

  • a name of the grocery item with the key identifier 'name'
  • the number of grocery items purchased with the key identifier 'number'
  • the cost of the grocery item with the key identifier 'price'

grocery_history is a list of grocery item dictionary elements.

Task: Create the empty data structure

1. Create an empty dictionary with the variable name grocery_item.

2. Create an empty grocery_history list.

Grocery List Script -

Prompt - The list object type is one of the most important and frequently used types in a Python program. A list is a container, an object that groups related objects together. A list is also a sequence: The contained objects maintain a left-to-right positional ordering. Elements of the list can be accessed via indexing operations that specify the position of the desired element in the list. Each element in a list can be a different type, such as string, integer, float, or even other list.

A dictionary is another type of container object that is different from sequences like strings, tuples, and lists. Dictionaries contain references to objects as key- value pairs: Each key in the dictionary is associated with a value, much like each word in an English language dictionary is associated with a definition. Unlike sequences, the elements of a dictionary do not have a relative ordering of positions. Adding a value to a dictionary can be done either with brackets or using the keyword dict.

A programmer can use loops to execute the same code repeatedly as long as some condition is true. The loop expression is evaluated when the program reaches the loop statement. If the loop expression is true, then the indented code block, known as the loop body, is executed. At the end of the loop body, execution goes back to the while loop statement. The loop expression is evaluated again, and if true, the loop body is executed again. But, if the expression evaluates to false, then execution instead proceeds to code below the loop body. Each execution of the loop body is called an iteration, and looping is also called iterating.

Your task for this project is to create a very simple grocery list script. This script emphasizes the importance of using lists, dictionaries, and loop types within your script, and how the use of those functions shapes your approach to creating a script.

You will be working on this project in the Project Two: Grocery List Script module in Codio. Following the directions in that module, you will also be able to determine the exact placement of the comments you will need to make in the code. Follow the directions in the module in Codio to walk through the activity.

Your script and word response for this script should address the following critical elements:

I. In Your Script (Annotated Text File):

Refer to the directions in the module in Codio for how to export out and comment your completed script.

A. Identify examples of four uses of list operations in the script using comments in your code. Be sure your examples address each of the following:

i. Creating lists

ii. Adding and removing data from a list

iii. Accessing values in a list

iv. Modifying values in a list

B. Identify examples of four uses of dictionary operations using comments in your code. Be sure your examples address each of the following:

i. Creating dictionaries

ii. Adding and removing key-value pairs

iii. Accessing values using keys

iv. Modifying values

C. Identify examples of three uses of loop structures using comments in your code. Be sure your examples address each of the following:

i. Item-based for loops

ii. Index-based (range) for loops

iii. While loops

II. Applying Your Experience

Making mistakes when you learn to write code is common. It is part of learning. What is important is developing the skill of learning how to understand your errors and then fix them (debugging). For this part of your final project, you will respond to the following:

A. Reflecting on your experience with this activity, explain the importance of knowing how and when to use lists, dictionaries, and loop types.

Support your response with examples from the activity of the types of errors and your method for fixing them.

Note - This is a codio project. In addition to notes provided, which are there to explain the steps necessary to complete the project, explain each step of the process. Also need a 1 paragraph reflection on all of the problems that were encountered and what was learned through the process.

Attachment:- Assignment File.rar

Reference no: EM132236346

Questions Cloud

Relationship between organizational structure and culture : What is the relationship between organizational structure and culture? Provide examples and/or resources to defend your position.
The difference between a current and a long-term liability : What is the difference between a current and a long-term liability? Provide an example of each in the healthcare sector.
Focuses on the goals of society : 1 An insurance professional who focuses on the goals of society instead of his or her own goals is best serving the needs of which one of the following groups?
Do you see any ethical issues emerging out of health care : Examine one of the policy statements provided by "ACHE" and comment on how this code may differ in nature than the health care provider codes.
Create a very simple grocery list script : Introduction - Your task for this project is to create a very simple grocery list script. Create an empty dictionary with the variable name grocery_item
What is the probability that no customers are in system : What is the probability that no customers are in the system (Po)? What is the probability that no customers are in the system (Po)?
What musical features and social history set bluegrass apart : What musical features and social history set bluegrass apart from other types of country music? Give examples where appropriate
Why are planning and budgeting so important : Why are planning and budgeting so important to an organization's success? Reflect back on the topics covered in the course.
Describe current level of listening and non-verbal skills : BUS 311 – Managerial Communications - post university - Develop a PowerPoint focusing on five attractions. In addition to developing strong slides

Reviews

len2236346

2/17/2019 8:50:23 PM

Instructions: Please see the attachment for complete details. This is a codio project. In addition to notes provided, which are there to explain the steps necessary to complete the project; The writer will need to add notes to explain each step of the process. I also need a 1 paragraph reflection on all of the problems that were encountered and what was learned through the process. As you work through the project guide, be aware that before you submit the script draft you will need to add comments to meet the requirements found in the IT-140 Project Two Guidelines and Rubric: Grocery List Script Draft document. Although these comments can be added after you complete the guide, you will likely find it useful to add as much as possible while you work through the script.

len2236346

2/17/2019 8:50:16 PM

Guidelines for Submission: Your submission should include all annotated text files of code for the script, as well a Microsoft Word document that includes the reflection part of your assignment in which you explained the problem-solving approaches you employed (critical element II).

len2236346

2/17/2019 8:50:10 PM

Grading Guidelines - Identifies examples of four uses of list functions in the script using comments in your code. Identifies examples of four uses of dictionary functions using comments in your code. Identifies uses of loop functions using comments in your code. Explains the importance of knowing how and when to use lists, dictionaries, and loop types, and explanation is supported with examples from the activity about the types of errors and your method for fixing them. Submission is free of errors related use of citations, grammar, spelling, syntax, and organization and is presented in a professional and easy-to-read format.

Write a Review

Python Programming Questions & Answers

  Implement the triangle classification algorithm

Create a function that implements the Triangle Classification Algorithm. The algorithm has a lot of steps in it, but each step is simple.

  Write a python code for project named virtual election booth

Voter generates a pair of private and public keys - for the purpose of digital signature. Voter uses his private key to sign his request and the public key.

  Write a program to render an animated humanoid walking robot

Write a program to render an animated humanoid walking robot. r robot must have two arms and two legs that are made of cylinders. each arm is made of the upper arm and lower arm (forearm).

  Write python script that reads and analyses country metadata

ICT702 Task 2 - Theme: Child Mortality. In this second part of Task 2, you should write another Python script that reads and analyses the country metadata

  Write a client pingprogram in python

Write a client pingprogram in Python. Your client will send a simple ping message to a server, receive a correspondingpong message back.

  Write a function that will take two arguments

Write a function that will take two arguments: a word to be searched for and a list of strings containing the grid and write code to read, in turn, each line of the file, remove the newline character and append the resulting string to a list of stri..

  Write the python program to add two numbers

write the Python Program to Print Hello world? write the Python Program to Add Two Numbers? write the Python Program to Find the Square Root? write the Python Program to Calculate the Area of a Triangle.

  Write recursive function to and the lcs of two input string

Assignment: Introduction to Computer Science for Life Scientists. Write a recursive function to and the LCS of two input string of size n and m.

  Write a function that takes as input an image object

Write a function that takes as input an image object, crops it to make it a square, and returns the resulting object. You must write a function to accomplish this.

  What is some of the functionality that is possible

Need help in understanding a few things about Apple Script. What is some of the functionality that is possible

  Write a python script that reads and analyses the data

ICT702 Task 2 - Apply relevant Python programming concepts to a data analysis challenge - Read data from real sources and wrangle it into the form you need

  Calculate the accuracy of your linear classifier

Plot X,Y and the decision boundary. Make sure that you use a good plotting technique so that it is easy to distinguish which datapoint is X and which is Y. Calculate the accuracy of your linear classifier.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd