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
Who here has an old (preferably 80s) Toyota Celica i just bought mine and want to know how you guys like yours because mine is f
Maurinko [17]

Answer:

Explanation:

The 1980 Toyota Celica is a great car, it was my first car and I loved it. It has many luxury features that you don't see much in cars of that year. It is also extremely reliable and can take lots of use before beginning to give problems. I used to use it to get to and from school on a daily basis and it never once left me stranded. It includes power steering, cruise control, AC, etc. Not much more you can ask for in a car, it is also a very beautiful looking car, especially a well taken care of one. Enjoy your car.

8 0
2 years ago
Why ues storage unit?​
Jet001 [13]

Huh? I don’t understand your question... please be more specific so we can help you

6 0
2 years ago
A program that performs handy tasks, such as computer management functions or diagnostics is often called a/an ____________.
Elodia [21]

Answer:

DOS

Explanation:

Disk operating

4 0
2 years ago
5. Write a function that takes two lists of integers and returns a list containing tuples with corresponding elements from both
Allisa [31]

Answer:

def corresponding_of_lists(lst1, lst2):

   c = ""

   corresponding_list = []

   if (lst1 is None) or (lst2 is None):

       return None

   else:

       for i in lst1:

           for j in lst2:

               c = "(" + str(i) + "," + str(j) + ")"

               corresponding_list.append(c)

   return corresponding_list

Explanation:

- Create a function called corresponding_of_lists that takes two lists as parameter

- Initialize an empty list to hold the corresponding values

- Check if any of the lists are null, if they are return None

- Otherwise, get the corresponding elements and put them into the corresponding_list

Return the corresponding_list

7 0
3 years ago
The option to publish a file as a blog post is located in the____options on the File tab.
shtirl [24]
The answer is #2: Share
3 0
2 years ago
Other questions:
  • Write a program that inputs a line of text and uses a stack object to print the line reversed.
    14·1 answer
  • Which expense is a bank least likely to extend a line of credit for?
    13·2 answers
  • What is the purpose of a scatter plot introduction to computer applications
    6·2 answers
  • Program 4: But I haven’t taken Calculus yet! OK – we admit, this one might look nasty, but read on because it’s not that bad. On
    11·1 answer
  • You are contacted by a project organizer for a university computer science fair. The project organizer asks you to hold a forum
    10·1 answer
  • How do i code........​
    6·2 answers
  • The illustration shows different types of text language.
    5·2 answers
  • 2. The Warren Commission investigated the assassination of President _______________________ in 1964.
    6·1 answer
  • Who invented the first mechanical computer? in what year was it invented?.
    11·1 answer
  • Question 5 of 10
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!