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
How do I convert a number into a percentage in excel
Annette [7]

format>number>percent

Explanation:

You click the box you want to convert into a percentage and then at the top where it says file, edit, view, insert, format, data, tools, add-ons and help, click format then number and then percent. This should convert your number into a percentage.

8 0
3 years ago
What are ways to access Tasks view in Outlook? Check all that apply. Select To-Do List or Task Folder. View daily task lists in
SVETLANKA909090 [29]

Answer:

A. B. D. E.

Explanation:

edg 2021

8 0
3 years ago
Read 2 more answers
How does the rhythm of "The Raven" compare to "Casey at the Bat?"
katen-ka-za [31]

Answer:

Casey at the Bat: A Ballad of the Republic Sung in 1888' is the full title of an American poem written by Ernest Lawrence Thayer. The poem tells the story of the final half-inning of a baseball game. ... Not only is it a love song to the dramatic sport of baseball, but it is a ballad to 'the Republic in 1888'.

8 0
3 years ago
So i need help. my high-school class is using this computer programming site, i have no clue whats going on. anyone use CMU? ill
natali 33 [55]

Answer:

i am in middle school but i know what u mean. it i computer Sciene. dont worry. it i not hard. they might give you intruction on what to do So it wont be So hard. UwU. i belive in u

Explanation:

3 0
3 years ago
A computer is unable to successfully complete its boot sequence. The master book record is currently stored on the C drive.
k0ka [10]
The Master Boot Record (MBR for short) is the information in the first sector of the hard disk that shows how and where the operating system needs to be loaded.
3 0
3 years ago
Other questions:
  • Buildings must be wired to comply with the latest National Electrical Code to ensure that, with adequate maintenance, the instal
    11·1 answer
  • Owning provides _________ flexibility but can lead to _________ costs in the long-term.
    7·2 answers
  • The use of computers to combine data from multiple sources and create electronic dossiers of detailed information on individuals
    5·1 answer
  • In no less than two paragraphs, explain the risks and compliance requirements of moving data and services into the cloud.
    11·1 answer
  • The variable planet_distances is associated with a dictionary that maps planet names to planetary distances from the sun. Write
    12·1 answer
  • Return true if the given non-negative number is a multiple of 3 or 5, but not both. Use the % "mod" operator.
    12·1 answer
  • What is the next step Charlie should take to solve the problem
    10·2 answers
  • tell us things u did as a kid but don't want to admit to it (best gets brainly 5 stasr and a thank you)
    13·2 answers
  • In Outlook 2016, the Tell Me function can be accessed by
    15·2 answers
  • PLEASE HELP ASAP!! Timed test!!
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!