Define a function below, filter_only_strs, which takes a single argument of type list. Complete the function so that it returns a list that contains only the strings from the original list and no other data. It is acceptable to return an empty list if there are no strings in the original list.

def filter_only_strs(1st):
for x in lst:
if isinstance(x,str)==False:
lst.remove(x)
return ist Restore original file

Answers

Answer 1

Answer:

Explanation:

The code provided aside from some minor errors (fixed version down below) is correct, but it will never be able to accomplish what is being asked in the question. This is because this code is simply copying and returning the exact same list that is passed as an argument, because it is looping through it and comparing its own elements. In order to accomplish what is asked in the question, two lists need to be passed as parameters. The first would be the original list, and the second would be a list of test elements that will be used to compare and see if they exist in the original list. This would allow us to create a new list with only the elements that existed in the original list.

def filter_only_strs(lst):

   for x in lst:

       if not isinstance(x, str):

           lst.remove(x)

   return lst


Related Questions

C++
Is there any difference between Class and Structure? Prove with the help of example.

Answers

Answer:

5555

Explanation:

The class is reference type (it is a pointer and is assigned on the heap), structure and value type (and is allocated on the stack). The difference is important in terms of memory management.

Where is the start frame delimiter found in the Ethernet frame

Answers

The start frame delimiter found in the Ethernet frame is A preamble and begin body delimiter are a part of the packet on the bodily layer. The first  fields of every body are locations and supply addresses.

What is the cause of the body delimiter?

Frame delimiting, Addressing, and Error detection. Frame delimiting: The framing procedure affords essential delimiters which might be used to pick out a set of bits that make up a body. This procedure affords synchronization among the transmitting and receiving nodes.

The Preamble (7 bytes) and Start Frame Delimiter (SFD), additionally referred to as the Start of Frame (1 byte), fields are used for synchronization among the sending and receiving devices. These first 8 bytes of the body are used to get the eye of the receiving nodes.

Read more about the Ethernet :

https://brainly.com/question/1637942

#SPJ1

A candle shop is having its annual sale. votive candles cost $10 each. Any additional candles he purchased were 25% off. if dahir purchased 7 candles, how much money in dollars , did he spend.

Answers

Answer:

55 dollars

Explanation:

25 % of 10 is 2.50 $10-2.50=7.50 7.50 X 6= 45.

45 + 10 = 55.

Hope this helps and everything is well,

Azumayay

When identifying who will send a presentation, what are the two types of audiences?

Answers

Answer:

Explanation:Demographic audience analysis focuses on group memberships of audience members. Another element of audience is psychographic information, which focuses on audience attitudes, beliefs, and values. Situational analysis of the occasion, physical setting, and other factors are also critical to effective audience analysis.

Type the correct answer in the box. Spell all words correctly.

What type of network has cache servers that are connected to the original server?

A(n) ________ delivery network consists of cache servers that are connected to the original server.

Answers

Answer:

A Content Delivery Network (CDN) consists of cache servers that are connected to the original server.

In the formula =C5*$B$3, C5 is what type of cell reference?

relative
absolute
mixed
obscure

Answers

Answer:

relative

Explanation:

i just got a 100 and it says its right on odsyware

What are the important points
concerning critical thinking?
(Select all that apply.)
You must evaluate information.
You should use your feelings.
You need to practice the right skills
You need to be well-spoken
You can learn it quickly
You need to use logic and reason
You need to be unbiased and unemotional

Answers

Answer:

You must evaluate information

Explanation:

The first step to thinking critically is to accept information only after evaluating it. Whether it's something read or heard, critical thinkers strive to find the objective truth. In doing this, these employees evaluate by considering possible challenges and solutions. This process of vetting new information and considering outcomes is called evaluation.

Which are characteristics of Outlook 2016 email? Check all that apply.

The Inbox is the first folder you will view by default

While composing an email, it appears in the Sent folder.

Unread messages have a bold blue bar next to them.

Messages will be marked as "read" when you view them in the Reading Pane.

The bold blue bar will disappear when a message has been read.

Answers

Answer: The Inbox is the first folder you will view by default.

Unread messages have a bold blue bar next to them.

Messages will be marked as "read" when you view them in the Reading Pane.

The bold blue bar will disappear when a message has been read

Explanation:

The characteristics of the Outlook 2016 email include:

• The Inbox is the first folder you will view by default.

• Unread messages have a bold blue bar next to them.

• Messages will be marked as "read" when you view them in the Reading Pane.

• The bold blue bar will disappear when a message has been read.

It should be noted that while composing an email in Outlook 2016 email, it doesn't appear in the Sent folder, therefore option B is wrong. Other options given are correct.

Answer:

1

3

4

5

Explanation:

just did it on edge

Do exercises as follows:

a. Enter a whole number from keyboard, a while loop should calculate a sum of all numbers from one to that number that you entered
b. Enter a numeric score - grade of a test, your program should print a corresponding letter grade that matches the score.

For example, if you enter 89.3, the program should display "B", and if you enter 95.7, then the program displays "A"

Answers

Answer:

Explanation:

The following Java program asks the user for a number to be entered it and uses a while loop to sum up all the numbers from 1 to that one and print it to the console. Then it asks the user for a grade number and prints out the corresponding letter grade for that number.

file = open('text.txt', 'r')

total_rainfall = 0

for line in file:

   line = line.replace('\n', '')

   info = line.split(' ')

   info = [i for i in info if i != '']

   print(info[0] + " will have a total of " + info[1] + " inches of rainfall.")

   total_rainfall += int(info[1])

average = total_rainfall / 3

print("Average Rainfall will be " + str(average) + " inches")

Which of the following items are both an input and output device?

Answers

Answer:

Printer (output) Camera (input), and others

Explanation:

Question 20
When looking to create video content for your marketing strategy, what three best practices
should you look to include?

Answers

Answer:

Short, technical, include a call to action.

Relevant, short, entertaining.

Short, entertaining, include a call to action.

Explanation:

Overview
In this program, you will use incremental development to manipulate a list. Objectives Be able to:
Get a list of numbers Display the individual numbers of a list
Find the average and maximum of the numbers in a list Perform calculations on a number in a list Sort a list Description
Prompt the user for how many weights should be added to a list and get the weights (in pounds) from the user, one at a time.
Display the weights back to the user, along with the average and maximum weight.
Next, ask the user for a list location and convert the weight at that location to kilogra ms.
Next, display the sorted list. And finally, display the list of weights again, along with what the weights would be on Mars. One run of the full program is as follows:
Enter the number of weights: 4
Enter weight 1: 236.0
Enter weight 2: 89.5
Enter weight 3: 176.0
Enter weight 4: 166.3
Weights: [236.0, 89.5, 176.0, 166.3]
Average weight: 166.95
Max weight: 236.00
Enter a list location (1 - 4): 3
Weight in pounds: 176.00
Weight in kilograms: 80.00
Sorted list: [89.5, 166.3, 176.0, 236.0]
Weight on Earth: [89.5, 166.3, 176.0, 236.0]
Weight on Mars: [33.9, 62.9, 66.6, 89.3]
Think about how you would do this before you continue reading.
Come up with a very rough draft of how you would create this program.
Then see if it follows the same logic presented here.
If you do not know where to start, read the first step below and then try to construct the rest of the program on your own. Commonly, the hardest part of writing a program is knowing where to start. Try to begin without using the guide below. If you need more information on how to convert pounds to kilograms or how to convert the weight on earth to the weight on Mars, look at steps 4 and 6 below.
(1) Prompt the user for the number of weights and then prompt the user to enter the numbers, each corresponding to a person's weight in pounds. Store all weights in a list. Output the list. Ex: Enter the number of weights: 4 Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 176.0 Enter weight 4: 166.3 Weights: [236.0, 89.5, 176.0, 166.3]
(2) Output the average of the list's elements with two digits after the decimal point. Hint: Use a conversion specifier to output with a certain number of digits after the decimal point.
(3) Output the max list element with two digits after the decimal point. Ex: Enter the number of weights:
4 Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 176.0 Enter weight 4: 166.3 Weights: [236.0, 89.5, 176.0, 166.3] Average weight: 166.95 Max weight: 236.00
(4) Prompt the user for a number between 1 and the number of weights in the list. Output the weight at the user specified location and the corresponding value in kilograms. 1 kilogram is equal to 2.2 pounds. Ex: Enter a list location (1 - 4): 3 Weight in pounds: 176.00 Weight in kilograms: 80.00
(5) Sort the list's elements from least heavy to heaviest weight. Ex: Sorted list: [89.5, 166.3, 176.0, 236.0]
(6) Create another list for the weights on Mars. To compute weight on Mars, take the weight on Earth and divide by Earth's gravitational force, which is 9.81. Then multiply by the Mars gravitational force, which is 3.711. Use the built in Python function round() to round the Mars weights to 1 decimal point. Print out each set of weights as follows: Ex: If the sorted list of weights is [89.5, 166.3, 176.0, 236.0] Weight on Earth: [89.5, 166.3, 176.0, 236.0] Weight on Mars: [33.9, 62.9, 66.6, 89.3]
(7) Congratulate yourself on a job well done!

Answers

Answer:

The program in Python is as follows:

num_weight = int(input("Weights: "))

Weights = []

totalweight = 0

for i in range(num_weight):

   w = float(input("Weight "+str(i+1)+": "))

   Weights.append(w)

   totalweight+=w

print("Weights: ",Weights)

print('Average Weight: %.2f' % (totalweight/num_weight))

print('Maximum Weight: %.2f' % max(Weights))

num = int(input("Enter a number between 1 and "+str(num_weight)+": "))

print('Weight in kg: %.2f' % Weights[i-1])

print('Weight in lb: %.2f' % (Weights[i-1]/2.205))

Weights.sort()

print("Sorted weights: ",Weights)

weight_on_mars = []

for i in range(num_weight):

   weight_on_mars.append(round((Weights[i]/9.81 * 3.711),1))

print("Weights on mars: ",weight_on_mars)

print("Congratulations")

Explanation:

This gets the number of weights

num_weight = int(input("Weights: "))

This initializes the weights

Weights = []

This initializes the total weight to 0

totalweight = 0

The iterates through the number of weights

for i in range(num_weight):

This gets each weight

   w = float(input("Weight "+str(i+1)+": "))

This appends the weight to the list

   Weights.append(w)

This calculates the total weights

   totalweight+=w

This prints all weights

print("Weights: ",Weights)

Calculate and print average weights to 2 decimal places

print('Average Weight: %.2f' % (totalweight/num_weight))

Calculate and print maximum weights to 2 decimal places

print('Maximum Weight: %.2f' % max(Weights))

Prompt the user for input between 1 and the number of weights

num = int(input("Enter a number between 1 and "+str(num_weight)+": "))

Print the weight at that location in kg and lb

print('Weight in kg: %.2f' % Weights[i-1])

print('Weight in lb: %.2f' % (Weights[i-1]/2.205))

Sort weights and print the sorted weights

Weights.sort()

print("Sorted weights: ",Weights)

Create a new list for weights on mars

weight_on_mars = []

The following populates the list for weights on mars

for i in range(num_weight):

   weight_on_mars.append(round((Weights[i]/9.81 * 3.711),1))

Print the populated list

print("Weights on mars: ",weight_on_mars)

print("Congratulations")

What are three things to look for on a website to check if it is valid? (5 points)

Answers

Answer:

a) Check whether the website is of an Established Institution or not

b) Does the website cite their credentials?

c) The URL of the website

Explanation:

Three things to look for in order to check if the given website is valid or not are

a) Check whether the website is of an Established Institution or not

b) Does the website cite their credentials and also what is the date of website origin

c) The URL of the website is also a good way to check the creditability

Hi guys, I am in need of help. I have an HTML assignment due today at 11:59 PM and I have to work with video and animation. I am having trouble with working on keyframes because when I run my program, my video remains the same size. I do not know what I am doing wrong. I have attached a picture of my code. Please help me ASAP.

Answers

Answer:

Nothing much is wrong

Explanation:

Nothing much is wrong with it but then again I'm a full on computer geek, I assume you need to go back and re-read it and edit whatever you feel is wrong or incorrect it's like a gut feeling and you will have doubts on certain parts of what you are doing

Write a class called MonetaryCoin that is derived from the Coin class presented in Chapter 5 (the source code for Chapter 5 examples is available via Moodle). [6 pts] Store one integer and one float in the MonetaryCoin that represent its value and weight in grams, respectively. Add a third variable of your choice (related to a coin, of course) and use self-descriptive variable names for all three variables. Pass the values to the constructor in MonetaryCoin and save them to your variables.

Answers

Answer:

Explanation:

The following Java code creates the MonetaryCoin class that extends the Coin class. It then creates three variables representing the MonetaryCoin object which are its value, weight, and coinYear. These are all passed as arguments to the constructor and saved as instance variables.

public class MonetaryCoin extends Coin {

   

   int value;

   float weight;

   int coinYear;

   

   public void MonetaryCoin(int value, float weight, int coinYear) {

       this.value = value;

       this.weight = weight;

       this.coinYear = coinYear;

   }

}

Please help i’ll give you brainliest Please please

Answers

Hey

when we use quotation marks in a search it means we are looking for a phrase so lets say we want to find cats jumping off a bed we can either look up cats jumping off a bed with no quotation marks and the algorithm will try to look for keywords in the search so cat bed and jumping (it ignores words like a and off) but the way it doses all this we will most likely find an image of a cat on a bed or jumping on a bed but we may not find one of the cat jumping off a bed. so this is where quotation marks come in they will make the algorithm look just for images and links tagged with "cat jumping off a bed"

the plus sign is when we want to add things to the search so we would use the plus sign if we wanted to find a cat that was on a bed and jumping it would be like this cat+bed+jumping

the pipe symbol is used when we are looking for two things that are basically the same but with one key difference so lets say we wanted cats jumping on a bed or dogs jumping on a bed we would use it then

and the words or and not can not be used in a search engine as the algorithm can not tell if they are being used as a tag.

-scav

What is an interface in android? a) Interface acts as a bridge between class and the outside world.
b) Interface is a class. c) Interface is a layout file. d) None of the above

Answers

Answer:

Explanation:

Im thinking C hope this helps :))

The interface in an android serves as a layout file.

What is an User interface?

An User interface also called a UI, is an in-built system that serves as a hierarchy of layouts and widgets.

Thus, the interface in an android serves as a layout file.

Therefore, the Option C is correct

Read more about interface

brainly.com/question/5080206

Which element adjusts the space around the data in each cell of a table? adjusts the space around the data in each cell of a table.

Answers

Answer:

Increase/decrease indentation

Explanation:

Answer:

(Cellpadding) is actually the correct answer.

Explanation:

Cellpadding and cellspacing are two important features of an HTML table. Cellpadding sets the space around the data in each cell. Cellspacing sets the space around each cell in the table.

Given two integers as user inputs that represent the number of drinks to buy and the number of bottles to restock, create a VendingMachine object that performs the following operations:

Purchases input number of drinks Restocks input number of bottles.
Reports inventory Review the definition of "VendingMachine.cpp" by clicking on the orange arrow.
A VendingMachine's initial inventory is 20 drinks.

Ex: If the input is: 5 2
the output is: Inventory: 17 bottles

Answers

Answer:

In C++:

#include <iostream>

using namespace std;

class VendingMachine {

 public:

   int initial = 20;};

int main() {

 VendingMachine myMachine;

   int purchase, restock;

   cout<<"Purchase: ";  cin>>purchase;

   cout<<"Restock: ";  cin>>restock;

   myMachine.initial-=(purchase-restock);

   cout << "Inventory: "<<myMachine.initial<<" bottles";  

   return 0;}

Explanation:

This question is incomplete, as the original source file is not given; so, I write another from scratch.

This creates the VendingMachine class

class VendingMachine {

This represents the access specifier

 public:

This initializes the inventory to 20

   int initial = 20;};

The main begins here

int main() {

This creates the object of the VendingMachine class

 VendingMachine myMachine;

This declares the purchase and the restock

   int purchase, restock;

This gets input for purchase

   cout<<"Purchase: ";  cin>>purchase;

This gets input for restock

   cout<<"Restock: ";  cin>>restock;

This calculates the new inventory

   myMachine.initial-=(purchase-restock);

This prints the new inventory

   cout << "Inventory: "<<myMachine.initial<<" bottles";  

   return 0;}

Apply the Blue, Accent 1 fill color to the selected shape, is the filth option in the first row under Theme Cross, in power point

Answers

The theme cross row under the accent was fill

Given main() and the Instrument class, define a derived class, StringInstrument, for string instruments.
Ex. If the input is:
Drums Zildjian 2015 2500 Guitar Gibson 2002 1200 6 19
the output is:
Instrument Information: Name: Drums Manufacturer: Zildjian Year built: 2015 Cost: 2500 Instrument Information: Name: Guitar Manufacturer: Gibson Year built: 2002 Cost: 1200 Number of strings: 6 Number of frets: 19

Answers

Answer:

Explanation:

The following derived class called StringInstrument extends the Instrument class and creates the necessary private variables for number of Strings and number of Frets. Then it creates getter and setter methods for each of the variables. This allows them to be called within the main method that has already been created and output the exact sample output as seen in the question.

class StringInstrument extends Instrument {

   private  int numStrings, numFrets;

   public int getNumOfStrings() {

       return numStrings;

   }

   public void setNumOfStrings(int numStrings) {

       this.numStrings = numStrings;

   }

   public int getNumOfFrets() {

       return numFrets;

   }

   public void setNumOfFrets(int numFrets) {

       this.numFrets = numFrets;

   }

}

Treat others the way

a
Like they are your enemy
b
That is all the same
c
You want to be treated
d
The same as you treat your friend

Answers

Answer:

C.

Explanation:

But shi.it i dont treat ppl good when they disrespecting me or my friends i be putting them in hush mode.

NO LINKS
write a shell script to find the sum of all integers between 100 and 200 which are divisible by 9​

Answers

Answer:

#!/usr/bin/env bash

for num in {100..200}

do

   if [ $((num % 9)) -eq 0 ]

   then

       ((sum += num))

   fi

done

echo $sum

Explanation:

The output will be 1683.

The rectangular shapes on the Excel screen are known as ______.

Answers

Answer:

work area

Explanation:

mark me as A brainlist

im hoxorny im so freaky

Which of the following statements is true?

Group of answer choices

A.Only products made from plastic damage the environment

B.Products mostly of metal do the most damage to the environment

C.All products have some effect on the environment

D.Reducing the enciroment impact of products can be both dangerous and frustrating for users

Answers

Answer:

It due to the dirt subsatnces that get wired polluted and the chloroflurocarbons that destroy the ozone layer

Explanation:

7- Calculator
Submit Assignment
Submitting a text entry box or a file upload
Create a simple calculator program.
Create 4 functions - add, subtract, multiply and divide.
These functions will print out the result of the operation.
In the main program, ask the user to enter a letter for the operator to enter 2 float input values.
After the user enters the values, ask the user what operation they want to perform on the values-A, S, M, D or E to Exit
and
Make sure you check for divide by O.
Your program should continue until E is typed.
upload or copy your python code to the submission

Answers

Answer:

In this tutorial, we will write a Python program to add, subtract, multiply and ... In this program, user is asked to input two numbers and the operator (+ for ... int(input("Enter Second Number: ")) print("Enter which operation would you like to perform?") ch = input("Enter any of these char for specific operation +,-,*,/: ") result = 0 if .

Explanation:

Which options are available when using a combo box rather than a list box? Check all that apply. A user can type in the values. A user can search for a record. The combo box can sort through records. A user can get values from another query. The combo box includes drop-down menus. A user can retrieve values from another table.

Answers

Answer:

A, B, D, F

Explanation:

5. A restore program generally is included with what type of utility?
O A. Screen saver
O B. Antivirus
O C. Uninstaller
D. Backup

6. The interface that allows interaction with menus, and visual images such as
buttons:
A. Touchscreen user interface
O B. Menu driven Interface
O C. Graphical user interface
O D. Command line interface​

Answers

The answer is B because the rest of them doesn’t make scenes

What is a function in Microsoft Excel?
Question 1 options:

A holding area for the clipboard

A tool for creating charts

A method for checking spelling

A predefined calculation

Answers

Answer:

Tool for creating charts.

Explanation:

MS excel is clearly used for designing charts and spreadsheet in our daily life.

Multiple security concerns regarding biotechnology and animal research, or
pathogens and toxins are applicable to which two areas of specialized security?

Answers

Answer:

Pathogens are ubiquitous, found in hospital and research laboratories, scientific culture collections, infected people and animals, and the environment. The skills and equipment applied to solving challenges in medicine, ...

Research Centre for Emerging Pathogens with High Infectious Risk, Pasteur Institute. Côte d'Ivoire . ... independent laboratories areas and two animal suites, in addition to 20 BSL-2 and two BSL-3 laboratories.

Other Questions
Please help Ill give brainliest A rectangular painting measures 1/2 yards wide and 5/4 yards long find the area of the painting in square yards. A farmer bought a number of pigs for $160. However, 8 of them died before he could sell the rest at a profit of 6 per pig. His total profit was $8. How many pigs did he originally buy? Which geometric term best describes each figure To produce one or more other organisms.1.Life cycle 2.Inherited Trait3.Reproduce4.Offspring Explain the purpose of the Hitler Youth. What does DNA have to do before a cell divides? HELP PLEASE HELPPPPPP MEEE WITH THISSS Que son las palabras sinnimas ? Solve for y.2 (y + 3) = 5y Select the correct text in the passage.Which three sentences in this excerpt from Franklin D. Roosevelt's D "Day of Infamy" speech make an emotional appeal by suggesting thatAmerica's innocence was betrayed by certain enemies?Japan has, therefore, undertaken a surprise offensive extending throughout the Pacific area. The facts of yesterday speak for themselves. Thepeople of the United States have already formed their opinions and well understand the implications to the very life and safety of our nation.As Commander-in-Chief of the Army and Navy, I have directed that all measures be taken for our defense.Always will we remember the character of the onslaught against us. No matter how long it may take us to overcome this premeditated invasion,the American people in their righteous might will win through to absolute victory.I believe interpret the will of the Congress and of the people when I assert that we will not only defend ourselves to the uttermost but will makevery certain that this form of treachery shall never endanger us again.Hostilities exist. There is no blinking at the fact that our people,our territory and our interests are in grave danger.with confidence in our armed forces - with the unbounded determination of our peoplewe will gain the inevitable triumph - so help us God.ask that the Congress declare that since theunprovoked and dastardly attack by Japan on Sunday, December Seventh,1941, a state of war hasexisted between the United States and the Japanese Empire. How is motion involved in your lives? Condense logarithmic equation HELPIn the following acid-base reaction,NH4+ is theH2PO4- (aq) + NH3(aq) HPO42- (aq) + NH4+(aq) Using the standard normal table, the probability that Seths light bulb will last no more than 14,500 (P(z 1.25)) hours is about Who are the green mountain boys? Briefly discuss the advantages of place departmentalisation Consider the function f(x) = x3 + 34 over the interval [3, 4]. According to the extreme value theorem, the function has a minimum value of and a maximum value of . PLSHELPILLGIVEMOREIFITSRIGHT what is 1\10 x 1.2 >>>>>>>>>>>>>>>>>>>>>>>>