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
alex41 [277]
3 years ago
7

Write a python program to find factorial, use exception handling and display an appropriate message if the user inputs alphabets

instead of the number. Emulate Index error for a list and handle that exception. Find factorial for all numbers in a given list and display the result.
Computers and Technology
1 answer:
MrRissso [65]3 years ago
6 0

def func(lst):

   fac_lst = ([])

   try:

       for x in lst:

           i = 0

           fac = 1

           while i < x:

               fac *= (x - i)

               i += 1

           fac_lst.append(fac)

       return fac_lst

   except TypeError:

       return "Please input only numbers!"

   except IndexError:

       return "Please stay within the index!"

lst = ([1, 2, 3, 4, 5, 6, 7, 8])

print(func(lst))

I think this is what you're looking for. Best of luck.

You might be interested in
What feature does google docs have to allow users to work in a document?​
Pavel [41]

Answer:

Share.

Explanation:

Go to the Share button in the top right corner of the doc, and click it. Then type the email adress of who you want to work on it. (make sure the symbol to the right of the email is a little pencil Icon)

6 0
3 years ago
Which keyword lets you control the number of rows that are returned by a query?
Kaylis [27]
C all and that facts =)
4 0
4 years ago
The three tasks within data harmonization, namely: data consolidation, data cleansing, and data formatting use techniques called
-BARSIC- [3]

The three tasks within data harmonization, namely: data consolidation, data cleansing, and data formatting use techniques called harmonization rules that implement those tasks -The statement is true

Explanation:

Data harmonization refers to the process of combining the data of varying files and formats ,name conventions and columns and transforming the same into one data set.

Data harmonization refers to the process of integrating multiple data source into a single data set.

By adopting the Data harmonization technique we can reduce the problem of redundant data and conflicting standard

The name harmonization is an analogy to the process to harmonizing discordant music.

The goal of data harmonization is to find commonalities, identify critical data that need to be retained, and then provide a common standard.

6 0
4 years ago
Tamera has $500 she is looking to save for a class trip she wants to earn the most possible interest and will not need access to
Irina18 [472]
Money Market Account has higher interest rate than Savings Account and Savings Account pays similar interest as Certification of Deposit (CD). Checking Account has even smaller interest rate.
Answer: B ) Money Market Account. 

5 0
3 years ago
What would be one advantage and one risk of using an electric car?
Lemur [1.5K]
One advantage of using an electric car would be not having to pay for gas, one risk would be it malfunctioning.
4 0
3 years ago
Read 2 more answers
Other questions:
  • How can i put this sign in my keybord?<br><br> :::::<br> ^<br> Here is the sign
    8·1 answer
  • 1. (8 pts) Write an application that is including a three-question multiple choice quiz about Java programming language. Each qu
    8·1 answer
  • What process combines data from a list with the content of a document to provide personalized documentsWhat
    12·2 answers
  • How do computer worms spread​
    11·1 answer
  • What is the Matlab command to create a vector of the even whole numbers between 29 and 73?
    11·1 answer
  • What is the generic term for a mode or method of malware infection?
    8·1 answer
  • Which of the following statements is TRUE of business intelligence (BI) systems? Business intelligence systems are primarily use
    7·1 answer
  • Write an algorithm to convert lengh of your house from cm to meter​
    7·1 answer
  • Consider the following code snippet:
    10·1 answer
  • Treat others the way
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!