Question

Using python for this programming Factorial Ask the user to enter an integer number. Then print...

Using python for this programming

  1. Factorial

Ask the user to enter an integer number. Then print the factorial of that number

  1. Write a program to print the below

********                      (note: 8 stars)

*******

******

*****

****

***

**

*

  1. Ask the user to enter the speed of their car. Write an if-else statement that displays “Speed is normal” if the speed variable is within the range 24 to 56. If speed variable is outside this range it should display “speed is abnormal”
0 0
Add a comment Improve this question Transcribed image text
Answer #1
n = int(input("Enter a value for n: "))
f = 1
for i in range(n, 0, -1):
    f *= i
    for j in range(i):
        print('*', end='')
    print()

print("Factorial of {} is {}".format(n, f))

speed = float(input("\n\nEnter speed of car: "))
if 24 <= speed <= 56:
    print("Speed is normal")
else:
    print("speed is abnormal")
Add a comment
Know the answer?
Add Answer to:
Using python for this programming Factorial Ask the user to enter an integer number. Then print...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • DONE IN PYTHON The factorial of a non-negative integer n, denoted by n!, is the product...

    DONE IN PYTHON The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example, 5 ! = 5 × 4 × 3 × 2 × 1 = 120. The value of 0! is 1. Write a program, with comments, to do the following: 20 points Ask the user to enter a positive integer n. between 1 and 20 ; You may assume the user will enter...

  • Write a python program to compute the factorial of a given non-negative integer n. If the...

    Write a python program to compute the factorial of a given non-negative integer n. If the user inputs any integer outside the required, print “Error! Try again!”

  • Python 3: Write a program in python that asks the user to enter a number that...

    Python 3: Write a program in python that asks the user to enter a number that contains 4 digits, i.e. in the range [1000-9999]. Your program MUST take it as a number integer. Print each digit on a separate line.

  • (Python Programming)Write a Python program that prompts the user to enter a list of words and...

    (Python Programming)Write a Python program that prompts the user to enter a list of words and stores in a list only those words whose first letter occurs again within the word (for example, 'Baboon'). The program should display the resulting list.

  • In Python, write a program that asks the user for a positive integer number. If the...

    In Python, write a program that asks the user for a positive integer number. If the user enters anything else, the program would ask the user to re-enter a number or enter -1 to quit. If it is a positive number, the program then prints out a multiplication table that goes up to that number. For example, if the user enters 10, the output would look something like this. https://www.vectorstock.com/royalty-free-vector/multiplication-table-on-white-background-vector-2721686

  • USING PYTHON PLEASE Write a program that calculates the factorial value of a number entered by...

    USING PYTHON PLEASE Write a program that calculates the factorial value of a number entered by the user. Remember that x! =x* (x-1)* (x-2)*... *3+ 2* 1. Your program should check the value input by the user to ensure it is valid (i.e., that it is a number > =1). To do this, consider looking at the is digit() function available in Python. If the user enters an incorrect input, your program should continue to ask them to enter a...

  • In Python 3, Write a program that reads a set of floating-point values. Ask the user...

    In Python 3, Write a program that reads a set of floating-point values. Ask the user to enter the values, then print: The number of values entered. The smallest of the values The largest of the values. The average of the values. The range, that is the difference between the smallest and largest values. If no values were entered, the program should display “No values were entered” The program execution should look like (note: the bold values are sample user...

  • Write a program to print the hollow diamond of stars (*), ask the user to enter...

    Write a program to print the hollow diamond of stars (*), ask the user to enter an odd number as the height. For example, if user enters height as 7, output will look like: Y*

  • Write a python program that does the following. a. It asks the user to enter a...

    Write a python program that does the following. a. It asks the user to enter a 5-digit integer value, n. b. The program reads a value entered by the user. If the value is not in the right range, the program should terminate. c. The program calculates and stores the 5 individual digits of n. d. The program outputs a “bar code” made of 5 lines of stars that represent the digits of the number n. For example, the following...

  • Write a code using loop and flag function in python jupitior notebook: Ask the user for...

    Write a code using loop and flag function in python jupitior notebook: Ask the user for the number of items they bought. Also ask the price of each item they bought and quantity purchased. Display the total amount they owe. Ask the user for a number n. Calculate 1+2+3+….+n. Ask the user for a number n. Calculate 1*2*3*…*n. Ask the user for number of rows (r) and columns (c). Print * for r rows and c columns. Ask the user...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT