SlideShare a Scribd company logo
1 of 1
Download to read offline
2. (S points) Write a function to convert a list of strings into an indexed list of strings. Indices
for this particular.problem must start at 1. Examples: Input: List ("he11o", "world", "my", "cat",
"is", "grumpy", "today") Output: List( ("he1lo", 1), ("world", 2), ("my", 3), ("cat", 4), ("is", 5), (
"grumpy", 6), ("today", 7)) Restrictions: - Yqu are allowed to use just the basic list operations
such as cons of an element to a list (ia), concatenation of two lists ( ++ , or :.. operators) and list
length operations. - List API functions length, reverse, map, filter, foldleft and foldRight are
allowed. - No other list API functions. - var, loops or recursion are not allowed. Given program:
def nakeIndexedList (1st: List [ string ]):List[( String, Int )]1 /IYOUR SOLUTION Test
program: seb t1 - a0ktrodexsdhetsist (me12on) sad 02 - eaktetedexedtaus(tist ("he110%, -world"
1) sez 43 - exsatndergdederisit) A?eEt(ts - B11, thtsat 3 ta1led - your code returned (t3")
3. (5 points) Given a list of numbers, partition the list into a pair of lists where the first list
contains only the even numbers and the second list contains only the odd numbers. Both the
output lists must contain the elements in the same order as they occur in the input list. The result
of partition an empty list is a pair of empty lists. Example: Input: List (1,2,8,7,5) Output: (List
(2,8), List (1,7,5)) Restrictions: - Yqu are allowed to use just the basic list operations such as
cons of an element to a list (ii) and concatenation of two lists (++, or :.: operators). Page 2 of 3
Last update: 2023-03-15 - List API functions map, filter, foldheft and foldight but no other list
API functions.. - Do not use var, loops or recursion. Given program: def oddsyenPartition (1st:
List [Int]): (List [Int], List [ Int ]) = I //YOUR SOLUTION
Xa1 x= gdderenpartition(List (1,2,8,7,5)) assert (x.1=List(2,8) && x.2=List(1,7,5), anTegt 1
failed - your code returned $x") Ya1 Y= oddevenPartition (ist (23,18,20,15)) assert (y_1= List
(18,20) &E y2= List (23,15), s" Hest 2 failed -. your code returped sy") Ta1 z=
odderenPartition(List (14,12,18,20)) ssaert(z. 1= Liat (14,12,18,20)&6z.2= List () , sweat 3
failed -- your code returned $z) Tal w= oddevenPartition(List ()) assert (w. 1= List () th w. 2=
List (), JnTest 4 failed - your code returned $w")

More Related Content

Similar to 2. (S points) Write a function to convert a list of strings into an i.pdf

Python list manipulation basics in detail.pdf
Python list  manipulation basics in detail.pdfPython list  manipulation basics in detail.pdf
Python list manipulation basics in detail.pdfneonaveen
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To LispLISP Content
 
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxAssg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxfestockton
 
l. read Data This function is to read the input and store it into th.pdf
l. read Data This function is to read the input and store it into th.pdfl. read Data This function is to read the input and store it into th.pdf
l. read Data This function is to read the input and store it into th.pdffabmallkochi
 
Python programming Part -6
Python programming Part -6Python programming Part -6
Python programming Part -6Megha V
 
Data Structure -List Stack Queue
Data Structure -List Stack QueueData Structure -List Stack Queue
Data Structure -List Stack Queuesurya pandian
 
Please I want a detailed complete answers for each part.Then make.pdf
Please I want a detailed complete answers for each part.Then make.pdfPlease I want a detailed complete answers for each part.Then make.pdf
Please I want a detailed complete answers for each part.Then make.pdfsiennatimbok52331
 
Collections In Scala
Collections In ScalaCollections In Scala
Collections In ScalaKnoldus Inc.
 
11 Introduction to lists.pptx
11 Introduction to lists.pptx11 Introduction to lists.pptx
11 Introduction to lists.pptxssuser8e50d8
 
How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1Taisuke Oe
 
RANDOMISATION-NUMERICAL METHODS FOR ENGINEERING.pptx
RANDOMISATION-NUMERICAL METHODS  FOR ENGINEERING.pptxRANDOMISATION-NUMERICAL METHODS  FOR ENGINEERING.pptx
RANDOMISATION-NUMERICAL METHODS FOR ENGINEERING.pptxOut Cast
 

Similar to 2. (S points) Write a function to convert a list of strings into an i.pdf (20)

Python list manipulation basics in detail.pdf
Python list  manipulation basics in detail.pdfPython list  manipulation basics in detail.pdf
Python list manipulation basics in detail.pdf
 
LISP: Introduction to lisp
LISP: Introduction to lispLISP: Introduction to lisp
LISP: Introduction to lisp
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
 
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docxAssg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
Assg 07 Templates and Operator OverloadingCOSC 2336 Sprin.docx
 
Python lists
Python listsPython lists
Python lists
 
l. read Data This function is to read the input and store it into th.pdf
l. read Data This function is to read the input and store it into th.pdfl. read Data This function is to read the input and store it into th.pdf
l. read Data This function is to read the input and store it into th.pdf
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
 
Python programming Part -6
Python programming Part -6Python programming Part -6
Python programming Part -6
 
Data Structure -List Stack Queue
Data Structure -List Stack QueueData Structure -List Stack Queue
Data Structure -List Stack Queue
 
Ch-8.pdf
Ch-8.pdfCh-8.pdf
Ch-8.pdf
 
pyton Notes6
 pyton Notes6 pyton Notes6
pyton Notes6
 
Please I want a detailed complete answers for each part.Then make.pdf
Please I want a detailed complete answers for each part.Then make.pdfPlease I want a detailed complete answers for each part.Then make.pdf
Please I want a detailed complete answers for each part.Then make.pdf
 
Collections In Scala
Collections In ScalaCollections In Scala
Collections In Scala
 
Module-2.pptx
Module-2.pptxModule-2.pptx
Module-2.pptx
 
11 Introduction to lists.pptx
11 Introduction to lists.pptx11 Introduction to lists.pptx
11 Introduction to lists.pptx
 
How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1How to start functional programming (in Scala): Day1
How to start functional programming (in Scala): Day1
 
Groovy
GroovyGroovy
Groovy
 
Elm kyivfprog 2015
Elm kyivfprog 2015Elm kyivfprog 2015
Elm kyivfprog 2015
 
RANDOMISATION-NUMERICAL METHODS FOR ENGINEERING.pptx
RANDOMISATION-NUMERICAL METHODS  FOR ENGINEERING.pptxRANDOMISATION-NUMERICAL METHODS  FOR ENGINEERING.pptx
RANDOMISATION-NUMERICAL METHODS FOR ENGINEERING.pptx
 
List,Stacks and Queues.pptx
List,Stacks and Queues.pptxList,Stacks and Queues.pptx
List,Stacks and Queues.pptx
 

More from allwayscollection

19. In the past few weeks, we have seen the Federal Reserve and Tr.pdf
19.   In the past few weeks, we have seen the Federal Reserve and Tr.pdf19.   In the past few weeks, we have seen the Federal Reserve and Tr.pdf
19. In the past few weeks, we have seen the Federal Reserve and Tr.pdfallwayscollection
 
19) Una oficina de seis personas est� plagada de alto ausentismo. Se.pdf
19) Una oficina de seis personas est� plagada de alto ausentismo. Se.pdf19) Una oficina de seis personas est� plagada de alto ausentismo. Se.pdf
19) Una oficina de seis personas est� plagada de alto ausentismo. Se.pdfallwayscollection
 
17.16 Uno de los inconvenientes de la televisi�n por sat�lite es....pdf
17.16 Uno de los inconvenientes de la televisi�n por sat�lite es....pdf17.16 Uno de los inconvenientes de la televisi�n por sat�lite es....pdf
17.16 Uno de los inconvenientes de la televisi�n por sat�lite es....pdfallwayscollection
 
16.Sophia est� muy molesta. Le ha contado a su maestra sobre mensaje.pdf
16.Sophia est� muy molesta. Le ha contado a su maestra sobre mensaje.pdf16.Sophia est� muy molesta. Le ha contado a su maestra sobre mensaje.pdf
16.Sophia est� muy molesta. Le ha contado a su maestra sobre mensaje.pdfallwayscollection
 
16. The Plainfield Company has a long-term debt ratio (i.e., the rat.pdf
16. The Plainfield Company has a long-term debt ratio (i.e., the rat.pdf16. The Plainfield Company has a long-term debt ratio (i.e., the rat.pdf
16. The Plainfield Company has a long-term debt ratio (i.e., the rat.pdfallwayscollection
 
15.Durante el per�odo de julio a diciembre, el mismo Hospital mencio.pdf
15.Durante el per�odo de julio a diciembre, el mismo Hospital mencio.pdf15.Durante el per�odo de julio a diciembre, el mismo Hospital mencio.pdf
15.Durante el per�odo de julio a diciembre, el mismo Hospital mencio.pdfallwayscollection
 
15. valor 10.00 puntos Informaci�n requerida El enfoque c.pdf
15. valor 10.00 puntos Informaci�n requerida El enfoque c.pdf15. valor 10.00 puntos Informaci�n requerida El enfoque c.pdf
15. valor 10.00 puntos Informaci�n requerida El enfoque c.pdfallwayscollection
 
15. A principios de 2021, Waterway Industries hab�a retenido gananci.pdf
15. A principios de 2021, Waterway Industries hab�a retenido gananci.pdf15. A principios de 2021, Waterway Industries hab�a retenido gananci.pdf
15. A principios de 2021, Waterway Industries hab�a retenido gananci.pdfallwayscollection
 
142 Cranlal Nerwe Jumetion.pdf
142 Cranlal Nerwe Jumetion.pdf142 Cranlal Nerwe Jumetion.pdf
142 Cranlal Nerwe Jumetion.pdfallwayscollection
 
14. Essay Using the following information f�Using the followi.pdf
14. Essay Using the following information f�Using the followi.pdf14. Essay Using the following information f�Using the followi.pdf
14. Essay Using the following information f�Using the followi.pdfallwayscollection
 
14. Mary es una maestra de secundaria jubilada de 72 a�os. Ella in.pdf
14. Mary es una maestra de secundaria jubilada de 72 a�os. Ella in.pdf14. Mary es una maestra de secundaria jubilada de 72 a�os. Ella in.pdf
14. Mary es una maestra de secundaria jubilada de 72 a�os. Ella in.pdfallwayscollection
 
13. Alan, Bruce and Connie want to combine their property in a new c.pdf
13. Alan, Bruce and Connie want to combine their property in a new c.pdf13. Alan, Bruce and Connie want to combine their property in a new c.pdf
13. Alan, Bruce and Connie want to combine their property in a new c.pdfallwayscollection
 
13. La revisi�n judicial de las decisiones de las agencias gira en t.pdf
13. La revisi�n judicial de las decisiones de las agencias gira en t.pdf13. La revisi�n judicial de las decisiones de las agencias gira en t.pdf
13. La revisi�n judicial de las decisiones de las agencias gira en t.pdfallwayscollection
 
13. It is year 1225 and Easter Islanders are crafting their now well.pdf
13. It is year 1225 and Easter Islanders are crafting their now well.pdf13. It is year 1225 and Easter Islanders are crafting their now well.pdf
13. It is year 1225 and Easter Islanders are crafting their now well.pdfallwayscollection
 
20) The antibiotic penicillin is isolated from ________.A) B. subt.pdf
20) The antibiotic penicillin is isolated from ________.A) B. subt.pdf20) The antibiotic penicillin is isolated from ________.A) B. subt.pdf
20) The antibiotic penicillin is isolated from ________.A) B. subt.pdfallwayscollection
 
2.1 Estudio de caso un l�der emergente Tim T. retrata su vida com.pdf
2.1 Estudio de caso un l�der emergente Tim T. retrata su vida com.pdf2.1 Estudio de caso un l�der emergente Tim T. retrata su vida com.pdf
2.1 Estudio de caso un l�der emergente Tim T. retrata su vida com.pdfallwayscollection
 
2.4 CollaboratorsThe company should also understand the relationsh.pdf
2.4 CollaboratorsThe company should also understand the relationsh.pdf2.4 CollaboratorsThe company should also understand the relationsh.pdf
2.4 CollaboratorsThe company should also understand the relationsh.pdfallwayscollection
 
2. �Cu�l de los siguientes no es un rasgo de alta inteligencia cultu.pdf
2. �Cu�l de los siguientes no es un rasgo de alta inteligencia cultu.pdf2. �Cu�l de los siguientes no es un rasgo de alta inteligencia cultu.pdf
2. �Cu�l de los siguientes no es un rasgo de alta inteligencia cultu.pdfallwayscollection
 

More from allwayscollection (20)

19. In the past few weeks, we have seen the Federal Reserve and Tr.pdf
19.   In the past few weeks, we have seen the Federal Reserve and Tr.pdf19.   In the past few weeks, we have seen the Federal Reserve and Tr.pdf
19. In the past few weeks, we have seen the Federal Reserve and Tr.pdf
 
19) Una oficina de seis personas est� plagada de alto ausentismo. Se.pdf
19) Una oficina de seis personas est� plagada de alto ausentismo. Se.pdf19) Una oficina de seis personas est� plagada de alto ausentismo. Se.pdf
19) Una oficina de seis personas est� plagada de alto ausentismo. Se.pdf
 
17.16 Uno de los inconvenientes de la televisi�n por sat�lite es....pdf
17.16 Uno de los inconvenientes de la televisi�n por sat�lite es....pdf17.16 Uno de los inconvenientes de la televisi�n por sat�lite es....pdf
17.16 Uno de los inconvenientes de la televisi�n por sat�lite es....pdf
 
16.Sophia est� muy molesta. Le ha contado a su maestra sobre mensaje.pdf
16.Sophia est� muy molesta. Le ha contado a su maestra sobre mensaje.pdf16.Sophia est� muy molesta. Le ha contado a su maestra sobre mensaje.pdf
16.Sophia est� muy molesta. Le ha contado a su maestra sobre mensaje.pdf
 
16. The Plainfield Company has a long-term debt ratio (i.e., the rat.pdf
16. The Plainfield Company has a long-term debt ratio (i.e., the rat.pdf16. The Plainfield Company has a long-term debt ratio (i.e., the rat.pdf
16. The Plainfield Company has a long-term debt ratio (i.e., the rat.pdf
 
15.Durante el per�odo de julio a diciembre, el mismo Hospital mencio.pdf
15.Durante el per�odo de julio a diciembre, el mismo Hospital mencio.pdf15.Durante el per�odo de julio a diciembre, el mismo Hospital mencio.pdf
15.Durante el per�odo de julio a diciembre, el mismo Hospital mencio.pdf
 
15. valor 10.00 puntos Informaci�n requerida El enfoque c.pdf
15. valor 10.00 puntos Informaci�n requerida El enfoque c.pdf15. valor 10.00 puntos Informaci�n requerida El enfoque c.pdf
15. valor 10.00 puntos Informaci�n requerida El enfoque c.pdf
 
15.9142.618.571.4.pdf
15.9142.618.571.4.pdf15.9142.618.571.4.pdf
15.9142.618.571.4.pdf
 
15. A principios de 2021, Waterway Industries hab�a retenido gananci.pdf
15. A principios de 2021, Waterway Industries hab�a retenido gananci.pdf15. A principios de 2021, Waterway Industries hab�a retenido gananci.pdf
15. A principios de 2021, Waterway Industries hab�a retenido gananci.pdf
 
142 Cranlal Nerwe Jumetion.pdf
142 Cranlal Nerwe Jumetion.pdf142 Cranlal Nerwe Jumetion.pdf
142 Cranlal Nerwe Jumetion.pdf
 
14. Essay Using the following information f�Using the followi.pdf
14. Essay Using the following information f�Using the followi.pdf14. Essay Using the following information f�Using the followi.pdf
14. Essay Using the following information f�Using the followi.pdf
 
14. Mary es una maestra de secundaria jubilada de 72 a�os. Ella in.pdf
14. Mary es una maestra de secundaria jubilada de 72 a�os. Ella in.pdf14. Mary es una maestra de secundaria jubilada de 72 a�os. Ella in.pdf
14. Mary es una maestra de secundaria jubilada de 72 a�os. Ella in.pdf
 
13. Alan, Bruce and Connie want to combine their property in a new c.pdf
13. Alan, Bruce and Connie want to combine their property in a new c.pdf13. Alan, Bruce and Connie want to combine their property in a new c.pdf
13. Alan, Bruce and Connie want to combine their property in a new c.pdf
 
13. La revisi�n judicial de las decisiones de las agencias gira en t.pdf
13. La revisi�n judicial de las decisiones de las agencias gira en t.pdf13. La revisi�n judicial de las decisiones de las agencias gira en t.pdf
13. La revisi�n judicial de las decisiones de las agencias gira en t.pdf
 
13. It is year 1225 and Easter Islanders are crafting their now well.pdf
13. It is year 1225 and Easter Islanders are crafting their now well.pdf13. It is year 1225 and Easter Islanders are crafting their now well.pdf
13. It is year 1225 and Easter Islanders are crafting their now well.pdf
 
20) The antibiotic penicillin is isolated from ________.A) B. subt.pdf
20) The antibiotic penicillin is isolated from ________.A) B. subt.pdf20) The antibiotic penicillin is isolated from ________.A) B. subt.pdf
20) The antibiotic penicillin is isolated from ________.A) B. subt.pdf
 
2.1 Estudio de caso un l�der emergente Tim T. retrata su vida com.pdf
2.1 Estudio de caso un l�der emergente Tim T. retrata su vida com.pdf2.1 Estudio de caso un l�der emergente Tim T. retrata su vida com.pdf
2.1 Estudio de caso un l�der emergente Tim T. retrata su vida com.pdf
 
2.4 CollaboratorsThe company should also understand the relationsh.pdf
2.4 CollaboratorsThe company should also understand the relationsh.pdf2.4 CollaboratorsThe company should also understand the relationsh.pdf
2.4 CollaboratorsThe company should also understand the relationsh.pdf
 
2.5�108 concentration.pdf
2.5�108 concentration.pdf2.5�108 concentration.pdf
2.5�108 concentration.pdf
 
2. �Cu�l de los siguientes no es un rasgo de alta inteligencia cultu.pdf
2. �Cu�l de los siguientes no es un rasgo de alta inteligencia cultu.pdf2. �Cu�l de los siguientes no es un rasgo de alta inteligencia cultu.pdf
2. �Cu�l de los siguientes no es un rasgo de alta inteligencia cultu.pdf
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 

Recently uploaded (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 

2. (S points) Write a function to convert a list of strings into an i.pdf

  • 1. 2. (S points) Write a function to convert a list of strings into an indexed list of strings. Indices for this particular.problem must start at 1. Examples: Input: List ("he11o", "world", "my", "cat", "is", "grumpy", "today") Output: List( ("he1lo", 1), ("world", 2), ("my", 3), ("cat", 4), ("is", 5), ( "grumpy", 6), ("today", 7)) Restrictions: - Yqu are allowed to use just the basic list operations such as cons of an element to a list (ia), concatenation of two lists ( ++ , or :.. operators) and list length operations. - List API functions length, reverse, map, filter, foldleft and foldRight are allowed. - No other list API functions. - var, loops or recursion are not allowed. Given program: def nakeIndexedList (1st: List [ string ]):List[( String, Int )]1 /IYOUR SOLUTION Test program: seb t1 - a0ktrodexsdhetsist (me12on) sad 02 - eaktetedexedtaus(tist ("he110%, -world" 1) sez 43 - exsatndergdederisit) A?eEt(ts - B11, thtsat 3 ta1led - your code returned (t3") 3. (5 points) Given a list of numbers, partition the list into a pair of lists where the first list contains only the even numbers and the second list contains only the odd numbers. Both the output lists must contain the elements in the same order as they occur in the input list. The result of partition an empty list is a pair of empty lists. Example: Input: List (1,2,8,7,5) Output: (List (2,8), List (1,7,5)) Restrictions: - Yqu are allowed to use just the basic list operations such as cons of an element to a list (ii) and concatenation of two lists (++, or :.: operators). Page 2 of 3 Last update: 2023-03-15 - List API functions map, filter, foldheft and foldight but no other list API functions.. - Do not use var, loops or recursion. Given program: def oddsyenPartition (1st: List [Int]): (List [Int], List [ Int ]) = I //YOUR SOLUTION Xa1 x= gdderenpartition(List (1,2,8,7,5)) assert (x.1=List(2,8) && x.2=List(1,7,5), anTegt 1 failed - your code returned $x") Ya1 Y= oddevenPartition (ist (23,18,20,15)) assert (y_1= List (18,20) &E y2= List (23,15), s" Hest 2 failed -. your code returped sy") Ta1 z= odderenPartition(List (14,12,18,20)) ssaert(z. 1= Liat (14,12,18,20)&6z.2= List () , sweat 3 failed -- your code returned $z) Tal w= oddevenPartition(List ()) assert (w. 1= List () th w. 2= List (), JnTest 4 failed - your code returned $w")