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
Vanyuwa [196]
3 years ago
14

Write a for loop to verify that your function is correctly returning the expected output for the radius values between 0 and 11.

(Remember the issue you might run into when comparing floating point values? What do you need to do to correctly handle it in the pytest framework?
Computers and Technology
1 answer:
cupoosta [38]3 years ago
5 0

Answer:

(1)function areaOfCircle(radius)

import math

def areaOfCircle(radius):

return math.pi*radius*radius

(2)calling function areaOfCircle() with radius value 5 and 8

areaOfCircle(5)

areaOfCircle(8)

(3)

def test_areaOf_Circle_1():

import math

for radius in range(0,11):

assert areaOfCircle(radius) == math.pi*radius*radius

You might be interested in
Write code that prints: userNum ... 2 1 Print a newline after each number. Ex: userNum
ehidna [41]

Answer:

The program to this question can be given as follows:

Program:

public class data //defining class data

{

//main method

public static void main (String [] as) //declaring main method  

{

int userNum = 4; //declare variable userNum and assign value

for (userNum = 1; userNum <= 4; userNum++)  //loop for print values

{

System.out.println(userNum);  //print values in new lines.

}

}

}

Output:

1

2

3

4

Explanation:

In the above java program code firstly a class "data" is defined, inside this class the main method is defined in which an integer variable userNum is defined that holds a value that is "4".

  • In this method, a for loop is declare that uses variable userNum which starts from 1 and ends with a given value that is equal to 4.
  • Inside a for loop, the print function is used that print userNum variable each values in the newline.  

4 0
3 years ago
Heres a survey
vodka [1.7K]

food.

I'm a child of God snatching lost souls out of Hell

bake

I go to church

some is to much information to give thx and have a blessed day

4 0
3 years ago
Read 2 more answers
Anthony is deciding between different savings accounts at his bank. He has four options, based on how frequently interest compou
leonid [27]
Depends is the answer multiple choice
7 0
4 years ago
Read 2 more answers
Explain how you can compare the size of product to the size of a factor when multiplying fractions without actually doing the mu
777dan777 [17]
You can multiple or dived
4 0
3 years ago
Does any body know how to program a video game?<br> Because a got an idea
klio [65]

Answer:

well you have to take classes or use easier systems like scratch

Explanation:

8 0
3 years ago
Other questions:
  • Sugar can be listed in many different forms except
    9·1 answer
  • Which of the following statements is true of a database? a. It is a collection of unstructured data. b. It is accessed primarily
    14·1 answer
  • Why is art important to heritage?
    10·1 answer
  • A hacker has successfully infected an internet-facing server which he will then use to send junk mail, take part in coordinated
    13·1 answer
  • Microprocessors can’t directly understand programming languages, so programs have to be converted into _____________ that corres
    15·1 answer
  • Using 2 bytes, how many different characters can Unicode represent?
    14·1 answer
  • Which question about whale sharks is nonscientific?
    11·2 answers
  • Write a function that accepts an argument for a persons name. The method should loop through the number of characters in the nam
    7·1 answer
  • To use
    11·1 answer
  • The name for the instructions you write to a computer in a program
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!