answer.
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
malfutka [58]
2 years ago
5

Write a program that lets a user enter N and that outputs N! (N factorial, meaning N*(N-1)*(N-2)*..\.\*2*1). Hint: Initialize a

variable total to N (where N is input), and use a loop variable i that counts from total-1 down to 1. Compare your output with some of these answers: 1:1, 2:2, 3:6, 4:24, 5:120, 8:40320.
Computers and Technology
1 answer:
Mrac [35]2 years ago
6 0

Answer:

N = int(input("Enter a number: "))

total = N

for i in range(N-1, 1, -1):

   total *= i

   

print(total)

Explanation:

Ask the user for the input, N

Set the total N at the beginning

Create a for loop that iterates from N-1 to 1 inclusively. Inside the loop, multiply each number in that range and add the result to the total.

When the loop is done, print the total to see the result

You might be interested in
A company wants to inform a select list of it's regular customers about a flash sale. Which type of platform will it use to send
blondinia [14]
<h2>Answer :</h2>

In case of Flash Sale, usually company uses Instant messages or SMS. As there are chances customer in most of the cases don’t have access to their emails due to internet unavailability. However SMS can be directed towards customers without the requirements of an internet. In case of SMS, there are companies available that can shoot out targeted SMS based on cities or even an entire country at a very minimal price. Company can provided them there contacts as well as they have a list of numbers from different sources to which they can send instant messages.


5 0
2 years ago
PLEASE HELP PROGRAMMING WILL GIVE BRAINLIEST
JulijaS [17]
The fourth choice is correct.
5 0
2 years ago
Which of these statements regarding mobile games is true? A. They are typically played indoors. B. They have detailed environmen
Lyrx [107]

Answer:

c and d

Explanation:

6 0
2 years ago
Select the correct text in the passage.
aliina [53]

Answer: When was admitted, hospital authorities recorded his medical history. Then, placed in an ICU where his vital signs were constantly monitored.

Explanation: With the help of computers, medical histories are often kept in the computer for future reference. Machines are connected to computers to record vital signs.

4 0
2 years ago
When using preventative insecticides which holiday period should trigger an application?
Savatey [412]
Spring break around Easter I would believe
4 0
2 years ago
Read 2 more answers
Other questions:
  • Represent decimal number 8620 in (a) BCD, (b) excess-3 code, (c)2421 code, and (d) as a binary number
    7·1 answer
  • How efficient would a 6-bit code be in asynchronous transmission if it had 1 parity bit, 1 start bit, and 2 stop bits?
    5·1 answer
  • Assume that a kernel is launched with 1000 thread blocks each of which has 512 threads. If a variable is declared as a shared me
    6·1 answer
  • What three requirements are defined by the protocols used in network communications to allow message transmission across a netwo
    11·1 answer
  • Suppose that f is a function with a prototype like this: void f(________ head_ptr); // Precondition: head_ptr is a head pointer
    6·1 answer
  • You have enabled IPv6 on two of your routers, but on the interfaces you have not assigned IPv6 addresses yet. You are surprised
    10·1 answer
  • Raj, a recent graduate, has recently joined your organization as a Junior Business Analyst. He has been asked to conduct a Feasi
    11·1 answer
  • Double any element's value that is less than controlValue. Ex: If controlValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4
    8·2 answers
  • Define the instance method inc_num_kids() for PersonInfo. inc_num_kids increments the member data num_kids. Sample output for th
    10·1 answer
  • Given positive integer n, write a for loop that outputs the even numbers from n down to 0. If n is odd, start with the next lowe
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!