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
Marrrta [24]
3 years ago
9

How to create a function, called separate_int_and_str, which takes in a list and separates out the integer values and strings in

to their own lists in python?
Computers and Technology
1 answer:
gregori [183]3 years ago
4 0

Answer:

program :

def separate_int_and_str(list_1):# function to seprate the list.

   str_list=[] #list to hold the

   int_list=[]#list which holds the integer value.

   for x in list_1: #for loop to extract the list.

       if(type(x)==str): #if condition to check the type of the element.

           str_list.append(x)#create a list for the string value.

       elif(type(x)==int): #check condition for th einteger value.

           int_list.append(x)#create a list for the integer value.

Explanation:

  • The above-defined function is written in the python language, which used the code to separate the list for integer and the string value.
  • There are two lists define in the function which holds the integer and the string value separately.
  • There is a 'for' loop which scans the element of the list and checks the list by the help of type function which tells the class of the element.
  • Then if the type function states that the element is from the strong class, it will assign the element on the string list otherwise it assigns the element in the integer list.
You might be interested in
A county collects property taxes on the assessed value of property, which is 60 percent of its actual value. For example, if a h
Zolol [24]

Answer:

actual_value = float(input("Enter the actual value of a piece of property: "))

tax_rate = float(input("Enter the current tax rate for each $100.00 of assessed value: "))

assessed_value = actual_value * 0.6

tax = (assessed_value * tax_rate) / 100

print("The annual property tax is $" + str(tax))

Explanation:

*The code is in Python.

Ask the user to enter the actual value and the tax rate

Calculate the assessed value, multiply the actual value by 0.6

Calculate the tax, multiply the assessed value by the tax rate and divide result by 100

Print the tax

7 0
4 years ago
What is the ls option to list entries by lines instead of by columns?​
gogolik [260]

Sometimes I just meet some Unintelligen ppl

7 0
3 years ago
Assume you have written a method with the header num yourMethod(string name, num code). The method's type is ____ .
elena-s [515]

A method is written with the header 'num' yourMethod(string name, num code). The method's type is <u>'num'.</u>

In the context of programming. a header refers to supplemental data placed at the beginning of a block of data being transmitted or stored. In the context of the Java method, the header is where you tell the Java program what value type if any, the method will return (a string value, an int value, a double value,  etc). As well as the return type, you require a name for your method, which is also placed in the header. You can pass values over to your methods in between a pair of round brackets.

You can learn more about method in Java at

brainly.com/question/28489761

#SPJ4

8 0
1 year ago
How to connect tablet to your bluetooth at home?
anygoal [31]
Make sure both devices are enabled or are able to connect via Bluetooth. Set the tablet to "discover" mode. Or, you can have it scan for nearby Bluetooth devices. Select the device. Sometimes, you are prompted for a password or code. If you don't have the manual (which usually states it) you can use either 0000 or 1234. 
5 0
3 years ago
The ____ tool allows a user to connect to the active registry database and make changes that are effective immediately. editreg.
kenny6666 [7]
Regedit is the Answer
3 0
4 years ago
Other questions:
  • What does delegating access give someone the permission to do on behalf of the user? Choose two answers.
    5·1 answer
  • You use_____ to view an XPS file
    10·1 answer
  • Why isn't my rank move from ambitious to virsto i met all the requirements
    8·2 answers
  • To resize columns in a subform, press and hold or right-click the subform in the navigation pane, and tap or click ____ on the s
    12·1 answer
  • Presentation software is the best file type for writing a research paper. <br> True <br> False
    10·1 answer
  • Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the ga
    12·2 answers
  • A unique ability of people which sets them far apart from animals is:
    8·1 answer
  • View which is used to specify the tables fields , their data types and properties ​
    9·2 answers
  • If I got a monitor and kept my garbage laptop could I play games on max graphics?
    13·1 answer
  • The underlying color of a slide.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!