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
masya89 [10]
4 years ago
11

Write a Python function that returns the sublist of strings in aList that contain fewer than 4 characters. For example, if aList

Computers and Technology
1 answer:
NARA [144]4 years ago
6 0

Answer:

def sublist(aList):

   new_list = []

   for s in aList:

       if len(s) < 4:

           new_list.append(s)

   

   return new_list

Explanation:

Create a function called sublist that takes one parameter, aList

Inside the function, create a new_list that will hold the strings which are less than 4 characters. Create a for loop that iterates through the aList. If a string in aList is less than 4 characters, add it to the new_list. When the loop is done, return the new_list

You might be interested in
Are used to connect a computer to a telephone line for dial-up internet access
Stella [2.4K]
I mean it typically goes wall jack to filter to line...
5 0
4 years ago
Return the "centered" average of an array of ints, which we'll say is the mean average of the values, except ignoring the larges
denpristay [2]

Answer:

The code to this question can be defined as follows:

public double centeredAverage(ArrayList<Integer> nums) //defining a method centeredAverage that accepts an array nums

{

   if ((nums == null) || (nums.size() < 3))//define if block for check simple case value

   {

       return 0.0;//return float value

   }

   double sum = 0; //defining a double variable sum

   int smallest = nums.get(0);//defining integer variable and assign value

   int largest = nums.get(0);//defining integer variable and assign value

   for (int i = 0; i < nums.size(); i++) //defining for loop for stor ith value

   {

       int value = nums.get(i);//defining integer value variable to hold nums value

       sum = sum + value;//use sum variable for add value

       if (value < smallest)//defining if block to check value less then smallest

           smallest = value;//hold value in smallest variable  

       else if (value > largest)//defining else if block that checks value greater them largest value

           largest = value; //hold value in largest variable

   }

   sum = sum - largest - smallest;  // use sum to decrease the sum largest & smallest value

   return (sum / (nums.size() - 2)); //use return keyword for return average value

}

Explanation:

In the question, data is missing, that's why the full question is defined in the attached file please find it.

In the given code a method "centeredAverage" is used that accepts an array in its parameter and inside the method, if block is used that checks the cash value if it is true, it will return a float value.

In the next step, two integers and one double variable is defined, that use the conditional statement for check hold value in its variable and at the last use return keyword for return average value.

3 0
4 years ago
The purpose of a good web page design is to make it
meriva

Answer:

Hi , so your answer is that a good web page design is to make it easy to use and meaningful and able to help people .

Explanation:

Really hope i helped , have a nice day :)

5 0
3 years ago
Read 2 more answers
6. You should check your tire pressure
tatyana61 [14]
Answer

Once every week

3 0
3 years ago
Before hard disk drives were available, computer information was stored on:
kobusy [5.1K]
Floppy disks . is the answer
6 0
3 years ago
Other questions:
  • Given a double variable named areaofsquare write the necessary code to read in a value , the area of some square, into areaofsqu
    10·1 answer
  • A poem for coduction
    15·2 answers
  • Why aren’t white Wall auto tires as wide as they used to be?or why do most cars not have them at all?
    15·1 answer
  • Write a method named showChar. The method should accept two arguments: a reference to a String object and an integer. The intege
    6·1 answer
  • Networking device converts analog signals to digital ones?
    8·1 answer
  • Which administrative tool can you use to check your computer's health or troubleshoot problems with the operating system or soft
    11·2 answers
  • It is where the home tab is located where you can view all the all the formatting purpose <br>​
    11·1 answer
  • X = 10<br> y = 20<br> x &gt; y<br> print("if statement")<br> print("else statement")
    6·1 answer
  • Which of the following describes why graphical interfaces quickly became popular after their introduction to the mass market?
    5·1 answer
  • How does our behavior change when we know we're being watched?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!