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
malfutka [58]
4 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]4 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
Please help!!!! will mark brainliest!!
fgiga [73]

Answer:

1. Speaking or texting on the cell phone while driving.

= It cause an accident.

2. Using technology for bullying others.

Hope this answer will help you.

7 0
3 years ago
Read 2 more answers
Determine if the following identifiers are valid. If they are invalid, state the reason. For example, the identifier min value i
Natasha2012 [34]

Answer:

Explanation:

Determine if the following identifiers are valid. If they are invalid, state the reason. For example, the identifier min value is invalid as it uses a whitespace.

road

mid_point

8ball

break

_log_value

EVERY1

[email protected]

_log

NewNumber

$varA

class

4 0
3 years ago
Repayment of a direct plus loan begins:
just olya [345]
The answer is D I hope i'm right


4 0
4 years ago
Read 2 more answers
What is the difference between science and technology how are they related
Nina [5.8K]
The Malawian in science are connected because of the echo system it's crossed the wrong way and they connect to each other
5 0
4 years ago
While an image is still being editing, it is best to save it as a PDF. Group of answer choices True False
Readme [11.4K]

Answer:

f

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Copying and pasting from the internet can be done without citing the internet page, because everything on the internet is common
    13·1 answer
  • Which commercial email provider is most closely associated with Apple devices?
    9·1 answer
  • Choose the appropriate of an image that supports the text. You should also make sure that the image is
    12·2 answers
  • The picture that graphically represents the items you use in windows is called a/an
    15·2 answers
  • This is not based on homework but I have a question. I am currently using a gtx 960 with a 6 core amd processor. Does anyone kno
    6·1 answer
  • Why do we need to measure the amperage of an electric current?​
    13·1 answer
  • Which of the following devices can be connected to a network? Check all of the boxes that apply.
    9·1 answer
  • Write features of Fifth Generation of computer?​
    12·2 answers
  • Which data type is used to teach a Machine Learning (ML) algorithm during structured learning?
    12·1 answer
  • Well I ended up figuring it out
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!