Define a function below, filter_out_strs, which takes a single argument of type list. Complete the function so that it returns a list that contains only the non-strings from the original list. It is acceptable to return an empty list if there are only strings in the original list. This question uses the filter pattern discussed in lecture.

Answers

Answer 1

Answer:

Explanation:

The following code is written in Python and is a simple function that removes all of the type String elements within the list that has been passed as an argument. Then finally, prints out the list and returns it to the user.

def filter_out_str(list):

   for x in list:

       if type(x) == type(" "):

           list.remove(x)

   print(list)

   return list

Define A Function Below, Filter_out_strs, Which Takes A Single Argument Of Type List. Complete The Function
Answer 2

Following are the python code to hold only string value into another list by using the given method:

Python code:

def filter_only_strs(l):#defining the method filter_only_strs that takes list type variable l in parameter

   r = []#defining an empty list r

   for x in l:#defining a loop that counts value of list

       if isinstance(x, str):#using if block that check list value is in string

           r.append(x)#using an empty list that holds string value

   return r#return list value

l=['d',12,33,"data"]#defining a list l

print(filter_only_strs(l))#calling the method filter_only_strs

Output:

Please find the attached file.

Program Explanation:

Defining the method "filter_out_strs", which takes one argument of list type that is "l".Inside the method, an empty list "r" is defined, and in the next line, a for loop is declared.Inside the for loop list "l" is used with a conditional statement that uses the "isinstance" method that checks string value in the list and adds its value in "r", and returns its value.

Find out more about the list in python here:

brainly.com/question/24941798

Define A Function Below, Filter_out_strs, Which Takes A Single Argument Of Type List. Complete The Function

Related Questions

What would provide structured content that would indicate what the code is describing ?
A.XML
B.DHTML
C.WYSIWYG
D.HTML

Answers

Answer: The answer is a.

Explanation:

Write a function named printPattern that takes three arguments: a character and two integers. The character is to be printed. The first integer specifies the number of times that the character is to be printed on a line (repetitions), and the second integer specifies the number of lines that are to be printed. Also, your function must return an integer indicating the number of lines multiplied by the number of repetitions. Write a program that makes use of this function. That is in the main function you must read the inputs from the user (the character, and the two integers) and then call your function to do the printing.

Answers

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

    char c;

    int n1, n2;

   

 System.out.print("Enter the character: ");

 c = input.next().charAt(0);

 System.out.print("Enter the number of times that the character is to be printed on a line: ");

 n1 = input.nextInt();

 System.out.print("Enter the number of lines that are to be printed: ");

 n2 = input.nextInt();

 

 printPattern(c, n1, n2);

}

public static int printPattern(char c, int n1, int n2){

    for (int i=0; i<n2; i++){

        for (int j=0; j<n1; j++){

            System.out.print(c);

        }

        System.out.println();

    }

    return n1 * n2;

}

}

Explanation:

*The code is in Java.

Create a function named printPattern that takes one character c, and two integers n1, n2 as parameters

Inside the function:

Create a nested for loop. Since n2 represents the number of lines, the outer loop needs to iterate n2 times. Since n1 represents the number of times that the character is to be printed, the inner loop iterates n1 times. Inside the inner loop, print the c. Also, to have a new line after the character is printed n1 times on a line, we need to write a print statement after the inner loop.

Return the n1 * n2

Inside the main:

Declare the variables

Ask the user to enter the values for c, n1 and n2

Call the function with these values

A sensitive manufacturing facility has recently noticed an abnormal number of assembly-line robot failures. Upon intensive investigation, the facility discovers many of the SCADA controllers have been infected by a new strain of malware that uses a zero-day flaw in the operating system. Which of the following types of malicious actors is MOST likely behind this attack?
A. A nation-state.
B. A political hacktivist.
C. An insider threat.
D. A competitor.

Answers

Answer:

A. A nation-state.

Explanation:

Given that a nation-state attack if successful is about having access to the different sector or industries of networks, then followed it by compromising, defrauding, altering (often for fraud purpose, or destroy information

Therefore, in this case, considering the information giving above, the type of malicious actor that is MOST likely behind this attack is "a Nation-State."

Create an array of doubles to contain 5 values Prompt the user to enter 5 values that will be stored in the array. These values represent hours worked. Each element represents one day of work. Create 3 c-strings: full[40], first[20], last[20] Create a function parse_name(char full[], char first[], char last[]). This function will take a full name such as "Noah Zark" and separate "Noah" into the first c-string, and "Zark" into the last c-string. Create a function void create_timecard(double hours[], char first[], char last[]). This function will create (write to) a file called "timecard.txt". The file will contain the parsed first and last name, the hours, and a total of the hours. See the final file below. First Name: Noah

Answers

Solution :

[tex]$\#$[/tex]include [tex]$<stdio.h>$[/tex]  

[tex]$\#$[/tex]include [tex]$<string.h>$[/tex]    

void parse[tex]$\_$[/tex]name([tex]$char \ full[]$[/tex], char first[tex]$[],$[/tex] char last[tex]$[])$[/tex]

{

// to_get_this_function_working_immediately, _irst

// stub_it_out_as_below._When_you_have_everything_else

// working,_come_back_and_really_parse_full_name

// this always sets first name to "Noah"

int i, j = 0;

for(i = 0; full[i] != ' '; i++)

  first[j++] = full[i];

first[j] = '\0';  

// this always sets last name to "Zark"

j = 0;

strcpy(last, full+i+1);

// replace the above calls with the actual logic to separate

// full into two distinct pieces

}

int main()

{

char full[40], first[20], last[20];

double hours[5];

// ask the user to enter full name

printf("What is your name? ");

gets(full);

// parse the full name into first and last

parse_name(full, first, last);

// load the hours

for(int i = 0; i < 5; i++)

{

   printf("Enter hours for day %d: ", i+1);

   scanf("%lf", &hours[i]);

}

// create the time card

FILE* fp = fopen("timecard.txt", "w");

fprintf(fp, "First Name: %s\n", first);

fprintf(fp, "Last Name: %s\n", last);

double sum = 0.0;

for(int i = 0; i < 5; i++)

{

   fprintf(fp, "Day %i: %.1lf\n", i+1, hours[i]);

   sum += hours[i];

}

fprintf(fp, "Total: %.1f\n", sum);    

printf("Timecard is ready. See timecard.txt\n");

return 0;

}

How are BGP neighbor relationships formed
Automatically through BGP
Automatically through EIGRP
Automatically through OSPF
They are setup manually

Answers

Answer:

They are set up manually

Explanation:

BGP neighbor relationships formed "They are set up manually."

This is explained between when the BGP developed a close to a neighbor with other BGP routers, the BGP neighbor is then fully made manually with the help of TCP port 179 to connect and form the relationship between the BGP neighbor, this is then followed up through the interaction of any routing data between them.

For BGP neighbors relationship to become established it succeeds through various phases, which are:

1. Idle

2. Connect

3. Active

4. OpenSent

5. OpenConfirm

6. Established

Define and use in your program the following functions to make your code more modular: convert_str_to_numeric_list - takes an input string, splits it into tokens, and returns the tokens stored in a list only if all tokens were numeric; otherwise, returns an empty list. get_avg - if the input list is not empty and stores only numerical values, returns the average value of the elements; otherwise, returns None. get_min - if the input list is not empty and stores only numerical values, returns the minimum value in the list; otherwise, returns None. get_max - if the input list is not empty and stores only numerical values, returns the maximum value in the list; otherwise, returns None.

Answers

Answer:

In Python:

def convert_str_to_numeric_list(teststr):

   nums = []

   res = teststr.split()

   for x in res:

       if x.isdecimal():

           nums.append(int(x))

       else:

           nums = []

           break;

   return nums

def get_avg(mylist):

   if not len(mylist) == 0:

       total = 0

       for i in mylist:

           total+=i

       ave = total/len(mylist)

   else:

       ave = "None"

   return ave

def get_min(mylist):

   if not len(mylist) == 0:

       minm = min(mylist)

   else:

       minm = "None"

   return minm

def get_max(mylist):

   if not len(mylist) == 0:

       maxm = max(mylist)

   else:

       maxm = "None"

   return maxm

mystr = input("Enter a string: ")

mylist = convert_str_to_numeric_list(mystr)

print("List: "+str(mylist))

print("Average: "+str(get_avg(mylist)))

print("Minimum: "+str(get_min(mylist)))

print("Maximum: "+str(get_max(mylist)))

Explanation:

See attachment for complete program where I use comment for line by line explanation

Write a method, public static int insertSort(ArrayList list), which implements a insertion sort on the ArrayList of Integer objects list. In addition your insertSort method should return an int which represents a statement execution count recording how many times two elements from the ArrayList are compared. For example, if the parameter list prints as [3, 7, 2, 9, 1, 7] before a call to insertSort, it should print as [1, 2, 3, 7, 7, 9] after the method call. This call should return the value 10 since 10 values need to be compared to implement an insertion sort on this array.

Answers

Answer:

Here is the basics of insertionSort performed on an array of integers, this should get you started:

/**

* The insertionSort method performs an insertion sort on an int array. The

* array is sorted in ascending order.

*

* param array The array to sort.

*/

public static void insertionSort(int[] array) {

int unsortedValue;

int scan;

for (int index = 1; index < array.length; index++) {

unsortedValue = array[index];

scan = index;

while (scan > 0 && array[scan - 1] > unsortedValue) {

array[scan] = array[scan - 1];

scan--;

}

array[scan] = unsortedValue;

}

}

The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the file is the following: Write a program that inputs a filename from the user and prints to the terminal a report of the wages paid to the employees for the given period. The report should be in tabular forma

Answers

Answer:

In Python:

fname = input("Filename: ")

a_file = open(fname)

lines = a_file.readlines()

print("Name\t\tHours\t\tTotal Pay")

for line in lines:

eachline = line.rstrip(" ")

for cont in eachline:

 print(cont,end="\t")

print()

Explanation:

This prompts the user for file name

fname = input("Filename: ")

This opens the file

a_file = open(fname)

This reads the lines of the file

lines = a_file.readlines()

This prints the header of the report

print("Name\t\tHours\t\tTotal Pay")

This iterates through the content of each line

for line in lines:

This splits each line into tokens

eachline = line.rstrip(" ")

This iterates through the token and print the content of the file

for cont in eachline:

 print(cont,end="\t")

print()

A function prototype ... specifies the function's name and type signature, but omits the function implementation. specifies the function's implementation, but omits the function's name and type signature. creates multiple functions with different argument lists. is used as an initial example of a correct function signature. overloads an existing function to accept other argument types.

Answers

Answer:

specifies the function's name and type signature, but omits the function implementation.

Explanation:

I will answer the question with the following illustration in C++:

double func(int a);

The above is a function prototype, and it contains the following:

double -> The function type

func -> The function name

int a -> The signature which in this case, is the parameter being passed to the function

Notice that the above does not include the function body or the implementation.

Hence, (a) is correct

Hello! I am a new coder, so this is a simple question. But I am trying to create a code where you enter a number, then another number, and it divides then multiply the numbers. I put both numbers as a string, and as result when i tried to multiply/divide the numbers that were entered, an error occurred. How can i fix this?

using System;

namespace Percentage_of_a_number
{
class Program
{
static object Main(string[] args)
{
Console.WriteLine("Enter percentage here");
string Percentage = Console.ReadLine();


Console.WriteLine("Enter your number here");
string Number = Console.ReadLine();

String Result = Percentage / 100 * Number;


}
}
}

Answers

no longer returns an error but your math seems to have something wrong with it, always returns 0

Console.WriteLine("Enter a percentage here");

   int Percent = int.Parse(Console.ReadLine());

   Console.WriteLine("Enter your number here");

   int Number = int.Parse(Console.ReadLine());

   int result = Percent / 100 * Number;

What is the effective address generated by the following instructions? Every instruction is

Independent of others. Initially

BX=0x0100, num1=0x1001, [num1]=0x0000, and SI=0x0100

a. mov ax, [bx+12]

b. mov ax, [bx+num1]

c. mov ax, [num1+bx]

d. mov ax, [bx+si]​

Answers

D. Mov ax, [bx+si] is your answer

Explain 2 ways in which data can be protected in a home computer??

Answers

Answer:

The cloud provides a viable backup option. ...

Anti-malware protection is a must. ...

Make your old computers' hard drives unreadable. ...

Install operating system updates. ...

Victoria turned in a rough draft of a research paper. Her teacher commented that the organization of the paper needs work.

Which best describes what Victoria should do to improve the organization of her paper?

think of a different topic
try to change the tone of her paper
clarify her topic and make it relevant to her audience
organize her ideas logically from least important to most important

Answers

Answer:

D

Explanation:

D would be correct

EDGE 2021

how to do GCD on small basic?​

Answers

The other person is right

17. Ano ang tawag sa pahina ng Excel?
a. Column
b. Columnar
c. Sheet page
d. Spread sheet​

Answers

D

Explanation:

D.spread sheet

........,,............:-)

why is an increase in tax rate not necessarily increase government revenue​

Answers

Answer:

An increase in tax rate raises more revenue than is lost to offsetting worker and investor behavior

Explanation:

Increasing rates beyond T* however would cause people not to work as much or not at all, thereby reducing total tax revenue

Which of the following is step two of the Five-Step Worksheet Creation Process?

Answers

Answer:

Add Labels.

As far as i remember.

Explanation:

Hope i helped, brainliest would be appreciated.

Have a great day!

   ~Aadi x

Add Labels is step two of the Five-Step Worksheet Creation Process. It helps in inserting the data and values in the worksheet.

What is label worksheet in Excel?

A label in a spreadsheet application like Microsoft Excel is text that offers information in the rows or columns around it. 3. Any writing placed above a part of a chart that provides extra details about the value of the chart is referred to as a label.

Thus, it is Add Labels

For more details about label worksheet in Excel, click here:

https://brainly.com/question/14719484

#SPJ2

Which functions do you use to complete Step 3e? Check all that apply.

Animations tab
Animation styles
Design
Lines
Motion Paths
Reordering of animations

Answers

Answer: Animations tab

Animation styles

Lines

Motion paths

Explanation: Edg2021

A signal has a wavelength of 1 11m in air. How far can the front of the wave travel during 1000 periods?

Answers

Answer:

A signal has a wavelength of 1 μm in air

Explanation:

looked it up

Do you think that dealing with big data demands high ethical regulations, accountability, and responsibility of the person as well as the company? Why​

Answers

Answer:

i will help you waiting

Explanation:

Yes dealing with big data demands high ethical regulations, accountability and responsibility.

The answer is Yes because while dealing with big data, ethical regulations, accountability and responsibility must be strictly followed. Some of the principles that have to be followed are:

Confidentiality: The information contained in the data must be treated as highly confidential. Information must not be let out to a third party.Responsibility: The people responsible for handling the data must be good in analyzing big data. They should also have the required skills that are needed.Accountability: The service that is being provided has to be very good. This is due to the need to keep a positive work relationship.

In conclusion, ethical guidelines and moral guidelines have to be followed while dealing with big data.

Read more at https://brainly.com/question/24284924?referrer=searchResults

Lists and Procedures Pseudocode Practice For each situation, provide a pseudocoded algorithm that would accomplish the task. Make sure to indent where appropriate. Situation A Write a program that: Takes the list lotsOfNumbers and uses a loop to find the sum of all of the odd numbers in the list (hint: use Mod). Displays the sum. Situation B Write a procedure that takes

Answers

Answer:

The pseudocoded algorithm is as follows:

Procedure sumOdd(lotsOfNumbers):

    oddSum = 0

    len = length(lotsOfNumbers)

    for i = 0 to len - 1

         if lotsOfNumbers[i] Mod 2 != 0:

              OddSum = OddSum + lotsOfNumbers[i]

Print(OddSum)

Explanation:

This defines the procedure

Procedure sumOdd(lotsOfNumbers):

This initializes the oddSum to 0

    oddSum = 0

This calculates the length of the list

    len = length(lotsOfNumbers)

This iterates through the list

    for i = 0 to len-1

This checks if current list item is odd

         if lotsOfNumbers[i] Mod 2 != 0:

If yes, the number is added to OddSum

              OddSum = OddSum + lotsOfNumbers[i]

This prints the calculated sum

Print(OddSum)

)Assume passwords are limited to the use of the 95 printable ASCII characters and that all passwords are 10 characters in length. Assume a password cracker with an encryption rate of 6.4 million encryptions per second. How long will it take to test exhaustively all possible passwords on a UNIX system

Answers

Answer:

296653 years

Explanation:

The length of password = 10

To get possible password:

95 printable password raised to power 10

= 95¹⁰

Then we calculate time it would take to break password

95¹⁰/6.4million

95¹⁰/6400000

= 9355264675599.67 seconds

From here we get minutes it would take. 60 secs = 1 min

= 9355264675599.67/60

= 155921077927 minutes

From here we get number of hours it would take 1 hr = 60 mins

155921077927/60

= 2598684632 hours

From here we calculate number of days it would take. 24 hrs = 1 day

2598684632/24

= 108278526 days

From here we calculate number of years it would take. 365 days = 1 ye

= 108278526/365

= 296653 years

It would take this number of years to test all possible passwords

An External Style Sheet uses the ________ file extension.

Answers

Answer:

css file extension

Explanation:

The question is straightforward and requires a direct answer.

In web design and development, style sheets are written in css.

This implies that they are saved in .css file extension.

Hence, fill in the gap with css

What are well known AI (Artificial Intelligence) Tools and Platform?​

Answers

Answer:

Thi s is your answer

Explanation:

Scikit Learn.

TensorFlow.

Theano.

Caffe.

MxNet.

Keras.

PyTorch.

CNTK.

A drunkard in a grid of streets randomly picks one of four directions and stumbles to the next intersection, then again randomly picks one of four directions, and so on. You might think that on average the drunkard doesn’t move very far because the choices cancel each other out, but that is actually not the case. Represent locations as integer pairs (x, y). Implement the drunkard’s walk over 100 intersections, starting at (0, 0), and print the ending location.

Answers

Answer:

its c so its c

Explanation:

is amazon a e-commerce website
o true
o false

Answers

Answer:

It is an online shopping website.

It’s online shopping.. so ig

what does command do

Answers

The command key’s purpose is to allow the user to enter keyboard commands in applications and in the system.

Under which command group will you find the options to configure Outlook rules?
O Move
O New
O Quick Steps
O Respond

Answers

Answer:

Move

Explanation:

I hope that helps :)

Answer:

a). move

Explanation:

edge 2021 <3

Netscape browser is one of Microsoft products
o true
o false

Answers

Answer:

FALSE. Netscape navigator web browser was developed by Netscape Communications Corporation, a former subsidiary of AOL.

Suppose you attend a party. To be sociable, you will shake hands with everyone else. Write the algorithm that will compute the total number of handshakes that occur. (Hint: Upon arrival, each person shakes hands with everyone who is already there. Use the loop to find the total number of handshakes as each person arrives.)

Answers

Answer:

Following are the flowchart to the given question:

Explanation:

Other Questions
Compound area figuring out this problem . Thank you for those who are able to help with this . Please someone help me with the question Olivia goes to Egypt and saw a model of triangle shaped pyramid. She enlarging using a scale factor of 1.2. What will be the perimeter and area of the new triangle pyramid? 10 pointsWhat is an abiotic or biotic factor that controls the number of individuals in a population called?A. a food,B. a niche.C. a pollutant.D. a limiting factor, Where are diploid cells found ? A. only in reproductive organs B. only in twin siblings C. through out the body D. only in the lungs Which of the following clams accurately describes Johan Ernst Nilson's primary mohvation for the Pole2P de Expedition? Whats the answer??????? Write balanced complete ionic equation for CaS(aq) + CaCl2 (aq) > CdS(s) + CaCl2 (aq). Express your answer as a chemical equation. Identify all of the phases in your answer. What do you write to order a product from a magazine?A) narrativeB) business letterC) research reportD) outline IF YOU DONT KNOW DONT ANSWER!!!!!!! and I give b if correct :) HELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAP Beowulf's victory is mainly symbolic of __________.Question 3 options:A divine plan or fateHrothgar's flaws.severe discipline.an unsympathetic setting. Mercutio: "Nay, gentle Romeo, we must have you dance." Romeo: "Not I, believe me. You have dancing shoes With nimble soles; I have a soul of lead So stakes me to the ground I cannot move." Read the following story summary.In a military court, a renegade general is on trial for actingon his own authority and endangering the lives of Americansoldiers. Two young lawyers are faced with challenging thegeneral, which is an uphill battle because of the general'sexcellent reputation.What theme is suggested by the story's setting? NO FAKE ANSWERS I NEED THIS DONE TODAY I NEED AT LEAST 1 PARAGRAPH IN EACH BOX WHOEVER ANSWERS ALL of the boxes iIl GIVE YOU BRAINLIEST!! Question 4El esposo de mi hermana es mimadrinacuadosuegraO nieto The diagonals of square ABCD intersect at point E. If BE = 2x + 1, and AC = 3(6x 4), find BD.A1B3C6D9 someone help, please this is due today, and its delta math if someone can help me 1/2 (6x - 4) + 4x = 26 HELP AGAIN PLEASE REEEEEEEEEEEEE