Drop links or images here to add them to the editor.

In a make task you use the skills you have learned to create a program from scratch. There is no starter code: you begin with an empty editor.

This one is all about getting data out of a list: one item at a time, two items joined together, the whole list at once, and finally an item the user picks.

The data

So that the output can be checked automatically, the list is fixed. Start your program with exactly this line:

fruit = ["Apple", "Banana", "Grape", "Strawberry", "Melon", "Orange"]

It holds six items, so its indices run from 0 to 5.

Your task

Print seven lines, in this order.

  1. The item at index 3.
  2. The item at index 5.
  3. The item at index 0 and the item at index 2, joined into one line with a single space between them. Use + to join them, and do not type either fruit out in full.
  4. Banana. Work out its index and print it the same way as the first two.
  5. The whole list, in one go, with a single print.
  6. Ask the user for a number between 0 and 5. Ask the question with its own print, exactly as written:
    Enter a number between 0 and 5:
    

    Read the answer with a bare input() and cast it with int().

  7. Print the item at the position the user asked for.

The output

The first five lines are the same every time the program runs:

Strawberry
Orange
Apple Grape
Banana
['Apple', 'Banana', 'Grape', 'Strawberry', 'Melon', 'Orange']

Line five is what a whole list looks like when Python prints it: the square brackets, the quotes and the comma and space between each pair of items are all part of the output.

The sixth line is the question, printed exactly as written above, and the seventh is whichever item the user asked for, printed on its own.

Example

Input:

0

Output:

Strawberry
Orange
Apple Grape
Banana
['Apple', 'Banana', 'Grape', 'Strawberry', 'Melon', 'Orange']
Enter a number between 0 and 5:
Apple

(index 0 is the first item in the list)


Input:

4

Output:

Strawberry
Orange
Apple Grape
Banana
['Apple', 'Banana', 'Grape', 'Strawberry', 'Melon', 'Orange']
Enter a number between 0 and 5:
Melon

Input:

5

Output:

Strawberry
Orange
Apple Grape
Banana
['Apple', 'Banana', 'Grape', 'Strawberry', 'Melon', 'Orange']
Enter a number between 0 and 5:
Orange

(index 5 is the last item, because a six-item list has no index 6)

The question is part of the output that is checked here, so its spelling, capital letters and punctuation count. Ask it with its own print, exactly Enter a number between 0 and 5:, and read the answer with a bare input() on the next line, rather than passing the question to input(...).

Help! My code doesn't work!

Make sure that you check for the following things:

  • The list name is spelled identically everywhere it is used, capital letters included.
  • The index is surrounded by square brackets.
  • List indexing starts at zero. Are you counting properly?
  • The largest index in this list is 5, not 6.
  • The space on the third line comes from a string of its own, " ", between the two items.
  • Printing the whole list uses the list name without any square brackets after it.
  • The number the user types is wrapped in int() before it is used as an index.