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
An example of a(n) ____ reconnaissance attack is a user who sends SQL injections to a system in hopes of generating some type of
Elden [556K]
The answer to this question is A
7 0
3 years ago
Read 2 more answers
Type the correct answer in the box. Spell the words correctly.
ExtremeBDS [4]

Answer:

The IT field yeah am sure

7 0
3 years ago
Desinated for a network connection within a largecity or multiple small citys
frozen [14]

I think it is WAN (Wide Area Network).

6 0
3 years ago
A hard drive that is running slowly may not have been a0properly.
kipiarov [429]
Its outdated maybe because of time issues or over-usage<span />
6 0
3 years ago
Read 2 more answers
Draw the following diagrams to represent the information system chosen in assignment 1 Context diagram The context diagram is ex
larisa86 [58]

An example of Context diagram that shows the Relevant system name and External Entities Input and output data flows is given in the image attached.

<h3>What is context diagram?</h3>

Context diagrams is known to be a depiction that is based on how external entities work together with a given system.

Note that it is said to be one of the most basic form of a data flow as it depicts a novel set of activities and also functions.

Therefore, An example of Context diagram that shows the Relevant system name and External Entities Input and output data flows is given in the image attached.

Learn more about  Context diagram from

brainly.com/question/12972996

#SPJ6

8 0
2 years ago
Read 2 more answers
Other questions:
  • If a pilot is converting standard time to UTC time and is given the time 1730 UTC, what would EST be?
    8·2 answers
  • What is the maximum number of VLANs that can be configured on a switch supporting the 802.1Q protocol? Why?
    11·2 answers
  • Write a program that first reads in the name of an input file, followed by two strings representing the lower and upper bounds o
    8·1 answer
  • Write a program that asks the user to enter the size of a triangle (an integer from 1 to 50). Display the triangle by writing li
    14·1 answer
  • Mrs. Zoo gave out the rubric for our essay. She stated that our essay should be complete by Friday of that week. I didn't have t
    13·1 answer
  • Your organization network diagram is shown in the figure below. Your company has the class C address range of 199.11.33.0. You n
    8·1 answer
  • Which type of network is the internet? choose the answer
    8·1 answer
  • In binary, the second digit from the right is multiplied by the first power of two, and the _____ digit from the right is multip
    10·2 answers
  • In a paragraph discuss 5 steps of saving a document in a storage device.<br>​
    5·1 answer
  • Advantages of using Unicode to represent data
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!