subject

This is a function that takes in a positive integer n, and returns True if the integer is a prime number, or False if it is not. def prime(n):
for i in range(2, n):
if n % i == 0:
return False
return True
Write a function all_primes(vals) that takes in a list of integers vals and returns the boolean value True if ALL of elements in the list are prime, or False otherwise.

For example, all_primes([3, 7, 2]) would return True (since all three of those numbers are prime), but all_primes([7, 11, 12, 17]) would return False (since 12 is not prime, even though the other three are).

You are required to call the prime function at least once within all_primes. You can assume that vals contains at least one element.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
Rachel completed typing an official document with a word processing program. she wants to make sure that her document has no typographical errors. she also wants all headings to have the same font. which features in a word processing program should she use? rachel should use the feature in a word processing program to find typographical errors. she should apply to have uniform headings.
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
How can a user delete a drawing object
Answers: 1
question
Computers and Technology, 24.06.2019 12:00
What is a sketch or blueprint of a web page that shows the structure (but not the detailed design) of basic page elements such as the logo, navigation, content, and footer?
Answers: 3
question
Computers and Technology, 24.06.2019 14:00
In the microsoft® access® and microsoft excel® programs, the ribbon contains tabs that are divided into with like tools in them. parts groups containers bunches
Answers: 1
You know the right answer?
This is a function that takes in a positive integer n, and returns True if the integer is a prime nu...
Questions
question
Chemistry, 29.06.2019 17:00
Questions on the website: 13722367