Question: Part 1: Read 2 numbers from the user. One small number and one big number for the range. Use this in a for loop with

  1. Part 1:

    1. Read 2 numbers from the user. One small number and one big number for the range.

    2. Use this in a for loop with range (for x in range(small, big))

    3. Add all the numbers in this range and store in a variable called total.

    4. Print total.

  2. Part 2:

    1. Make a list of colors called COLORS. Have at least 10 colors.

    2. Read one color from the user in a variable called color.

    3. Now use a for loop, and see if the color the user enters is there in your list.

    4. If it is there, output that their color is found, else, output color not found.

  3. Part 3:

    1. Now go through the list of colors and print all the colors that have 3 letters or less.

    2. Go through the list of colors and print all the colors that have 5 letters or more.

References:

Refer to this pdf file (link here) or refer here for more tutorials.

  • Section 1.13.2 The list Type

  • Section 1.13.3 The range Function, Part 1 from the pdf file

  • Section 1.13 Loops and Sequences from the pdf file.

My powerpoints in this module.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!