In "Rabbitville", the rabbit population squares each year. e.g. If you start with 4 rabbits, you'll have 16 in 1 year, and 256 in 2 years. Once the population exceeds 10,000 bunnies, food will be scarce, and population will begin to decrease.


Write a function years_till_no_carrots that includes a WHILE loop. Given a single integer (# of starting rabbits) as an input, your function should output the number of whole years until the number of rabbits becomes larger than 10000. e.g. years_till_no_carrots(4) = 3 (start with 4 rabbits, population greather than 10000 & food scarce in 3 years)

Answers

Answer 1

Answer:

In Python:

def years_till_no_carrots(n):

   year = 0

   while(n <= 10000):

       n=n**2

       year = year + 1

   

   return year

Explanation:

First, we define the function

def years_till_no_carrots(n):

Next, the number of years is initialized to 0

   year = 0

The following while loop is iterated until the population (n) exceeds 10000

   while(n <= 10000):

This squares the population

       n=n**2

The number of years is then increased by 1, on each successive iteration

       year = year + 1

   

This returns the number of years

   return year

To call the function from main, use (e.g): print(years_till_no_carrots(4))


Related Questions

In addition to bandages and gauze, it's recommended that a first aid kit also contain

Answers

Disinfectant supplies, such as wipes of gel.

can i have a answer

best answer gets brainliest

Answers

Answer: the square root of 25 is 5.

3 x 1,000 = 3,000

1,000,000 + 2,934 x 10 = 1,002,934,000

45 + 2,034 + 20 + 78 = 2,177

M a t h

Explain:

(Sorry it’s not all of them)

45 + 2,034 = 2,079 + 20 = 2,099 + 78 = 2,177

The square roots of 25 are √25=5 and −√25=−5 since 52=25 and (−5)2=25 . The principal square root of 25 is √25=5.

1,000 + 1,000 + 1,000 = 3,000 using multiplication makes it faster by saying 3 1,000 times is 3,000.

What characteristic makes a plaster tender a Job Zone One occupation?

Answers

Occupational


Good luck I just copied the guy I front lol

Answer:

They are basically unskilled laborers.

Explanation:

Part D
Look at the table again. What is the total number of watts used by a TV connected to a video game
system?

Answers

Answer:

I would say 185

Explanation:

If a TV is 150 watts and a video game sistem is 35 then you would have to add them together and you would then get 185. So a TV connected to a video game system would run at 185 watts.

) How can
we produce organic vegetables. Enplain briefly​

Answers

Answer:

Use natural substances in a garden

Explanation:

Organic producers rely on natural substances. Organic food is produced without using most conventional pesticides such as human made pesticides and fertilizers made with synthetic ingredients or sewage sludge, bioengineering, or ionizing radiation.  Have a sunny place for your garden, soil, and water to keep the plants healthy.

Which of the following characteristics is a feature of all planets?

They all have atmospheres.
They all make their own light.
They all have rings of rock and gas.
They all are round and made up of rock.

Answers

Answer:

They all are round and make up of rock

Answer:

a. They all have atmospheres - I took the test on FLVS

Explanation:

Which is the correct arrangement for the path of a person seeking training as an engineer?
A. Interview with accomplished engineers, attend a two-year college, and proceed to a specialty program
B. Receive a two-year specialized degree from an engineering school, and then work as an apprentice for five years
C. Complete a bachelor of science degree, master of technology degree, and then a PhD in whichever specialized area the person wants to pursue.
D. Complete a four-year bachelor's degree in a specialized field, work with a Professional Engineer, and take a Professional Engineering examination to earn a license

Answers

Answer:

b

Explanation:

Answer:

b

Explanation:

 

Select the correct answer.
Which statement best describes the functions of a power transformer?
A.
It converts DC voltage into AC voltage and vice versa.
B.
It converts high-voltage power into low-voltage power and vice versa.
C.
It maintains electrical voltage at a constant level.
D.
It eliminates noise from electric current supplied to critical applications.

Answers

......The answer is D

The statement which best describes the functions of a power transformer is: D. It eliminates noise from electric current supplied to critical applications.

What is a power transformer?

A  power transformer can be defined as an electronic device that is deigned and developed for the transmission of electrical power from one electrical circuit to another without any form of change in the frequency.

In conclusion, the functions of a power transformer is that it is designed to eliminate noise from electric current when supplied to critical applications because it operates on the principle of electromagnetic induction.

Read more on power transformer here: https://brainly.com/question/20940273

Other Questions
I need help quick because its timed. Pls help!!!!!!!!!!!!!!!!!!!! A board is 29ft long. The second piece is 4 times longer than the first. The third piece is 3 times longer than the second. What is the length of all pieces. As the human population grows, the size of cities increases. As cities grow, more land must be cleared to make way for homes, businesses, and roads. Which two events would be likely effects of replacing a forested area with an urban area? A. More air pollution because there are fewer trees to take in carbon dioxide B. Less erosion of soil as plants covering the ground are added to gardens C. Fewer birds and other wildlife because they have fewer places to live D. More trees because of increased solar energy in the area 3 4/5 3 1/2 divide reduce to the lowest term The Ice Chalet offers dozens of different beginning ice-skating classes. All of the class names are put into a bucket. The 5 P.M., Monday night, ages 8 to 12, beginning ice-skating class was picked. In that class were 64 girls and 16 boys. Suppose that we are interested in the true proportion of girls, ages 8 to 12, in all beginning ice-skating classes at the Ice Chalet. Assume that the children in the selected class are a random sample of the population.Required:Construct a 92% Confidence Interval for the true proportion of girls in the ages 8-12 beginning ice-skating classes at the Ice Chalet. 1. Many nonmetals are weak and2. The property of an element to be beaten into sheets isknown as3. The total space occupied by an object is5.is a gas and is an f(n) = 3(n+ 1). Find f(-2) Which threat would a rhinoceros be least able to detect ?A. A hunter with a strong odorB. A hunter in the distanceC. A fire with lots of smokeD. a nearby lion after a baby rhinoceros Pls answer thankyou Please look at the attachments! I will give brainlyest to correct answers! Montresor and Fortunato are wearing costumes because it is carnival time.One reason Montresor is wearing a costume is to be sure no one recognizes him when he is walking back to his house with Fortunato.Fortunato was a competitive person because he got jealous when he thought Luchesi was going to taste the Amontillado.Montresor leads Fortunato down into the catacombs where many people were buried.Montresor and Fortunato were down in the catacombs until midnight.Montresor was upset because Fortunato had seriously offended him and wanted revenge.No one ever found Fortunato, who Montresor buried alive down in the catacombs.Montresor kept giving Fortunato wine because he knew he could not resist it and wanted Fortunato to keep following him. please help me !!! easy question and ill give brainliest Olivia completed a high dive from a platform at a recent competition.The graph below shows her distance from the pool, in meters, as afunction of time, in seconds. Write the first 3 terms for the given formulaf(n) = 2n + 10 for starting with n = 1 Part 2: Free Response 11. The distribution of actual weights of 8-ounce chocolate bars produced by a certain machine is Normal with mean 8.1 ounces and standard deviation 0.1 ounces. Company managers do not want the weight of a chocolate bar to fall below 8 ounces, for fear that consumers will complain. (a) Find the probability that the weight of a randomly selected candy bar is less than 8 ounces. Two trains, Train A and Train B, weigh a total of 381 tons. Train A is heavier than Train B.The difference of their weights is 193 tons. What is the weight of each train? I need this answer quick! A quality assurance check is 91% accurate for non-defective devices and 97% accurate for defective devices. Of the devices checked, 84% are not defective. What is the probability of an incorrect conclusion? Round your answer to the nearest tenth of a percent. Rewrite the sentences with the words below.*a centenarian, an infant,in (your) teens,in (your) twenties,middle-aged,a toddler,a young child*1 My niece is only four months old.2 My little brother is six.3. My great-grandfather is over a hundred.4 My cousin Jack is fifteen5 My mother is fifty next year.6 My nephew is two years old.7 My sister was twenty-three on her last birthday If the anticodon of a molecule of tRNA has the sequence GAU, what was the original DNA sequence?