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
When do images or graphics in Microsoft Word hurt the document rather than help
Vinvika [58]

Answer:

When images or graphics excessively occupy most of the space on the page.

<u>Explanation:</u>

For example, if you observed the attached image you'll see a bad example in which the image excessively occupies most of the space on the page making the written text difficult to read.

Next, a good example of proper editing is found in the next image, which shows the written text properly aligned with the text.

3 0
3 years ago
A user's computer will not boot. A technician notices four indicator lights on the backside of the
vaieri [72.5K]

Answer:

B.

Explanation:

Computer manual is the user guide that comes along with the computer set to inform the users about the functions, ways to assemble the parts, and so on.

The user manual consists of guide for the users specially for electronic products such as computers, refrigerators; softwares, and so on. These manuals are written by technical writers, programmers, etc.

<u>In the given scenario the technician needs to refer to computer manual to know the meaning of the lights on the backside of the computer.</u>

So, the correct answer is option B.

6 0
3 years ago
Select all that apply. To select more than one worksheet at the same time, which of the following keys on your keyboard can you
Colt1911 [192]
<em>Shift </em>selects multiple worksheets at the same time. <em>Ctrl</em> selects all that you selected with Ctrl pressed.
4 0
4 years ago
Create an interactive program to use class a LightsOut class to allow a user to play a game. Each step in the game will require
expeople1 [14]

Answer:

9+10=21

Explanation:

wyd boy

8 0
3 years ago
What is the next line?
marissa [1.9K]

Explanation:

solução de ácido clorídrico (HCI 6 m e HCI 0,6 m)

7 0
3 years ago
Other questions:
  • What is client server relationship is the basic form of what
    6·1 answer
  • Select the correct answer. Which of these is a function of the marketing team of a game development studio? A. creating art elem
    12·2 answers
  • Write a loop to print 10 to 90 inclusive (this means it should include both the 10 and 90), 10 per line.​
    6·1 answer
  • Please answer this I know that no one else does but I can't think right now
    10·1 answer
  • Signs of mastery include?
    10·1 answer
  • Each processor core on a multi core processor generally runs faster than a single core processor
    14·2 answers
  • In the ADT graph the methid addVertex has efficiency
    15·1 answer
  • What is the name of the unique identifier assigned to any personal computer that is connected to the internet?
    11·1 answer
  • Write a function that takes an integer value and returns the number with its digits reversed. for example, given the number 7631
    10·1 answer
  • When solving a problem in a group situation, which of the following traits should be demonstrated?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!