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]
3 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]3 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
Which of these lists correctly counts from 1 to 5 In binary
evablogger [386]

Answer:B

Explanation: it is b because counting to 5 in binary is 0=0 1=1 2=10 3=11 4=100 and 5=101 so when you add the exes zeros  it becomes B.

3 0
2 years ago
Data about the size and composition of a population are gathered in a survey called _____.
topjm [15]
Your answer is B. :) Hope this helps!
6 0
3 years ago
Read 2 more answers
Is the following statement TRUE or FALSE?
Musya8 [376]

Answer:

A

Explanation:

click on typeface icon in toolbar menu

6 0
3 years ago
PLEASE HELP THANK YOU
Andrei [34K]

Answer:

1) A string is "non-numeric data".  In other words, it is text.

2) False, a runtime error means that there is a problem, but it will be with the software, not the hardware.

3) An impossible task such as dividing five by zero is a logical error.  Not using quotes on a string would be a syntax error, printing an inaccurate statement is not an error at all (as far as the program is concerned anyway), and using camelcase on a variable with multiple words is a common convention.

4) variableName = "value"

5) The code provided here is illegible, so I can't give a straight answer. It seems to be missing operators.

6 0
3 years ago
How do you change colors for presentation to blue warm in power point?
Furkat [3]

In PowerPoint presentations you can change background color. The best way to do this is to change the template background color in the master view. This will let you use the same background color among the whole presentation and also for the new slides that you will create.

In order to change the background color in Microsoft PowerPoint 2010 we need to go to View and Slide Master. Then, right click on the first slide and click Format Background.

5 0
3 years ago
Other questions:
  • What type of code was Pinterest Pin button created in?
    10·1 answer
  • When reading data across the network (i.e. from a URL) in Python 3, what method must be used to convert it to the internal forma
    9·1 answer
  • Write the pseudo code to display the largest number from given 3 numbers.(n1,n2,n3,).
    10·1 answer
  • . Write a code to define a linked list node using the above defined structure student (i.e. the data of the node is a student st
    11·1 answer
  • Cual es el procedimientos para asistir en el transporte publico a personas discapacitadas
    6·1 answer
  • Lab 6B: printing a binary number
    13·1 answer
  • What do we call a statement that displays the result of computations on the screen
    12·2 answers
  • The distance between two walls is called what?
    8·2 answers
  • Which tool is used to see the wireless networks in a given area?
    5·1 answer
  • What is a security strategy comprised of products and services that offer remote support for mobile devices, such as smart phone
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!