Python Exercise

Using the methods indicated in the attached pdf files, download the starter file and complete this exercise.

Create a grocery list

Write a program to create a grocery list where the user will add items one at a time until entering the word “STOP”.
At that point, the program will print out the items in the grocery list, 1 item per line.

Sample output:

PS 1.1.png

Generate lotto numbers

Write a program that generates a list of 10 valid lottery tickets and then prints out the tickets, 1 per line.

Valid lottery tickets in Indiana have 6 values:

  • 5 numbers from 1 to 69 (represented by white balls)
  • 1 number from 1 to 26 (representing the red Powerball)

A valid lottery ticket might look like: 29-1-65-44-39-PB5

Sample output:

PS 1.2.png

Ask questions, print a response

First, ask the user the following three questions and store the answers in a nested list.

  • What is your name?
  • What is your quest?
  • What is your favorite color?

Store at least 6 sets of responses. Example nested list: [ [‘Sir Robin’ , ‘to find the Holy Grail’ , ‘red’] , [‘Matt’ , ‘to travel the world’ , ‘blue’], etc…]

Second, sort the list alphabetically by color and print out the results:

Sample output:

PS 1.3.png

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more