SlideShare a Scribd company logo
1 of 1
Download to read offline
Exercise 7 Use the function design recipe to develop a function named count_evens. The
function has one parameter, which is a list of integers. The list may be empty. The function
returns the number of even integers in the list. Your function definition must have type
annotations and a complete docstring. Your function must have exactly one loop. Use the Python
shell to test count_evens.

More Related Content

More from deepak596396

Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdfExercise- You will use the TCP echo client and server code (for IPv4 v.pdf
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf
deepak596396
 

More from deepak596396 (20)

D- Classifying Acids and Bases The pH of a solution is a number which.pdf
D- Classifying Acids and Bases The pH of a solution is a number which.pdfD- Classifying Acids and Bases The pH of a solution is a number which.pdf
D- Classifying Acids and Bases The pH of a solution is a number which.pdf
 
Deliverable- Create two single user empathy maps- as described below-.pdf
Deliverable- Create two single user empathy maps- as described below-.pdfDeliverable- Create two single user empathy maps- as described below-.pdf
Deliverable- Create two single user empathy maps- as described below-.pdf
 
d- By how much does the supply of money supply or contract- Supply of.pdf
d- By how much does the supply of money supply or contract- Supply of.pdfd- By how much does the supply of money supply or contract- Supply of.pdf
d- By how much does the supply of money supply or contract- Supply of.pdf
 
Define the following terms- and explain it in your own words with exam.pdf
Define the following terms- and explain it in your own words with exam.pdfDefine the following terms- and explain it in your own words with exam.pdf
Define the following terms- and explain it in your own words with exam.pdf
 
Deinococcus radiodurans is a bacteria with a very peculiar special abi.pdf
Deinococcus radiodurans is a bacteria with a very peculiar special abi.pdfDeinococcus radiodurans is a bacteria with a very peculiar special abi.pdf
Deinococcus radiodurans is a bacteria with a very peculiar special abi.pdf
 
Define a method printFeetinchShort- with int parameters numFeet and nu.pdf
Define a method printFeetinchShort- with int parameters numFeet and nu.pdfDefine a method printFeetinchShort- with int parameters numFeet and nu.pdf
Define a method printFeetinchShort- with int parameters numFeet and nu.pdf
 
Define a method named orderOfAppearance() that takes the name of a rol.pdf
Define a method named orderOfAppearance() that takes the name of a rol.pdfDefine a method named orderOfAppearance() that takes the name of a rol.pdf
Define a method named orderOfAppearance() that takes the name of a rol.pdf
 
D) there is little change across horizontal distances- Question 14 (Ma.pdf
D) there is little change across horizontal distances- Question 14 (Ma.pdfD) there is little change across horizontal distances- Question 14 (Ma.pdf
D) there is little change across horizontal distances- Question 14 (Ma.pdf
 
Define a method findResources() that takes two integer parameters as a.pdf
Define a method findResources() that takes two integer parameters as a.pdfDefine a method findResources() that takes two integer parameters as a.pdf
Define a method findResources() that takes two integer parameters as a.pdf
 
Exhibit 11-7 We want to test the hypothesis that population B has a.pdf
Exhibit 11-7    We want to test the hypothesis that population B has a.pdfExhibit 11-7    We want to test the hypothesis that population B has a.pdf
Exhibit 11-7 We want to test the hypothesis that population B has a.pdf
 
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdfExercise- You will use the TCP echo client and server code (for IPv4 v.pdf
Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf
 
Exercise 8 1- Discuss the relevance of the Dutch disease problem for.pdf
Exercise 8  1- Discuss the relevance of the Dutch disease problem for.pdfExercise 8  1- Discuss the relevance of the Dutch disease problem for.pdf
Exercise 8 1- Discuss the relevance of the Dutch disease problem for.pdf
 
EXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdf
EXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdfEXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdf
EXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdf
 
Exercise 3- Consider an exponentially distributed random variable f(X-.pdf
Exercise 3- Consider an exponentially distributed random variable f(X-.pdfExercise 3- Consider an exponentially distributed random variable f(X-.pdf
Exercise 3- Consider an exponentially distributed random variable f(X-.pdf
 
Exercise 5 Suppose that two dice were rolled and it was observed that.pdf
Exercise 5 Suppose that two dice were rolled and it was observed that.pdfExercise 5 Suppose that two dice were rolled and it was observed that.pdf
Exercise 5 Suppose that two dice were rolled and it was observed that.pdf
 
Exercise 4- Suppose that a Bernoulli-type experiment is carried out as.pdf
Exercise 4- Suppose that a Bernoulli-type experiment is carried out as.pdfExercise 4- Suppose that a Bernoulli-type experiment is carried out as.pdf
Exercise 4- Suppose that a Bernoulli-type experiment is carried out as.pdf
 
Exercise 4- These financial statement items are for Batra Corporation.pdf
Exercise 4- These financial statement items are for Batra Corporation.pdfExercise 4- These financial statement items are for Batra Corporation.pdf
Exercise 4- These financial statement items are for Batra Corporation.pdf
 
Exercise 3-4 For a system with discrete energy levels- give a formula.pdf
Exercise 3-4 For a system with discrete energy levels- give a formula.pdfExercise 3-4 For a system with discrete energy levels- give a formula.pdf
Exercise 3-4 For a system with discrete energy levels- give a formula.pdf
 
Exercise 3-16 (Algo) Weighted average- Production cost report LO P2 El.pdf
Exercise 3-16 (Algo) Weighted average- Production cost report LO P2 El.pdfExercise 3-16 (Algo) Weighted average- Production cost report LO P2 El.pdf
Exercise 3-16 (Algo) Weighted average- Production cost report LO P2 El.pdf
 
Exercise 2-1 What number should be moved into the OPTION register in o.pdf
Exercise 2-1 What number should be moved into the OPTION register in o.pdfExercise 2-1 What number should be moved into the OPTION register in o.pdf
Exercise 2-1 What number should be moved into the OPTION register in o.pdf
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
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...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

Exercise 7 Use the function design recipe to develop a function named.pdf

  • 1. Exercise 7 Use the function design recipe to develop a function named count_evens. The function has one parameter, which is a list of integers. The list may be empty. The function returns the number of even integers in the list. Your function definition must have type annotations and a complete docstring. Your function must have exactly one loop. Use the Python shell to test count_evens.