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
lord [1]
2 years ago
6

Fill in the blanks to make the factorial function return the factorial of n. Then, print the first 10 factorials (from 0 to 9) w

ith the corresponding number. Remember that the factorial of a number is defined as the product of an integer and all integers before it. For example, the factorial of five (5!) is equal to 1*2*3*4*5

Computers and Technology
1 answer:
nadezda [96]2 years ago
3 0

Answer:

Following are code of factorial in python language

def factorial(n): # function

   result=1 #variable

   for x in range(2,n+1): #iterating the loop

       result=result*x  #storing result

   return result #return result

for n in range(10): #iterating loop

   print(n,factorial(n)) #print factorial

Output:

Following are the attachment of output

Explanation:

Missing information :

In the question the information is missing the code is missing which we have to correct it following are the code that are mention below.

def factorial(n): # function

   result=1 #variable

   for x in range(       ): #iterating the loop

       result=  #storing result

   return  #return result

for n in range(  ): #iterating loop

   print(n,factorial(n)) #print factorial

Following are the description of code

  • We have create a function factorial  in this we have pass the one parameter i.e "n".
  • In the for loop we have pass 2,n+1 which has been used to iterating the loop calculating factorial and string the result in the result variable
  • In the main function we have pass the range on which we have to calculated the factorial
  • Finally the print function will print the factorial .

Following are the attachment snip of code in the python language

You might be interested in
Define an interface GUIComponent consisting of four method declaration: open: void-returning, accepts no parameters close: both
Lesechka [4]

Answer:

interface GUIComponent{

  public void open();

  public boolean close();

  public void resize(int width, int height);

  public void move(int x, int y);

}

Explanation:

3 0
2 years ago
a certain kind of fish in the ocean eats only algae. a seal eats this fish a bear eats the seal .when the bear dies,it’s recycle
STatiana [176]

Answer:seal

Explanation:

4 0
2 years ago
How many channels can the 2.4 GHz band be divided into?
wlad13 [49]

Answer:Fourteen channels

Explanation:

8 0
2 years ago
Who is the author of computer programming pdf
mash [69]
Donald Knuth<span> began the project, originally conceived as a single book with twelve chapters, in 1962.</span>
5 0
3 years ago
Which of the following does not illustrate an effect of media on human communication?
Lyrx [107]

I'd choose B as the answer.

Our entire social lives these days are mediated and we are now leaving in a mediated era. Social media, for instance, has profoundly influenced in inter-personal communication. Options A and D contributes to the interaction and the fulfillment of peoples’ social needs and social media has become a preferred mode of communication with the rise of digital and mobile technologies. Social media has negatively impacted and reduced face to face interactions of human beings, whether business wise or through personal communication. Option C also illustrates an effect of media on human communication, which only leaves us with option B

3 0
3 years ago
Other questions:
  • You must receive an invitation in order to join Pinterest. True or False?
    9·2 answers
  • 9. The best way to insert an existing Excel chart into a document is to A. use the Object command. B. click the Insert tab and c
    6·2 answers
  • 5. Why would you want to wear white or light colors on a summer day?
    5·1 answer
  • _______ view focuses on the text and content of a document, without much information on the page layout.
    7·1 answer
  • Impanation stage contain ​
    10·1 answer
  • Determine whether or not the following pairs of predicates are unifiable. If they are, give the most-general unifier and show th
    13·1 answer
  • Write an enhanced for loop that multiplies all elements in an int[] array named factors, accumulating the result in a variable n
    11·1 answer
  • PLEASE HELP!!! THIS IS DUE TODAY! WILL MARK BRAINLIEST!
    5·1 answer
  • In 1980, IBM's cheapest computer was more affordable than Apple's.<br><br><br> True<br><br> False
    10·1 answer
  • What is the key difference between a class and an object
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!