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
Como realizar un cuadro comprativo?​
Kruka [31]
How to make a comparison chart?
3 0
3 years ago
Briefly describe the importance of thoroughly testing a macro before deployment. What precautions might you take to ensure consi
Shalnov [3]

Answer:

Answered below

Explanation:

A macro or macroinstruction is a programmable pattern which translates a sequence of inputs into output. It is a rule that specifies how a certain input sequence is mapped to a replacement output sequence. Macros makes tasks less repetitive by representing complicated keystrokes, mouse clicks and commands.

By thoroughly testing a macro before deployment, you are able to observe the flow of the macro and also see the result of each action that occurs. This helps to isolate any action that causes an error or produces unwanted results and enable it to be consistent across end user platforms.

8 0
3 years ago
Which of the following networks had these two goals: a) allowing scientists to work together on scientific projects; and, b) fun
MatroZZZ [7]

Answer: ARPANET

Explanation: ARPANET is network based on the internet which uses the technique of sending data in small packets/units known as packet switching . It helps in effective communication in the field of military while even some nuclear attack destructs the network. It was a method used in the scientific field for the ease of work of scientists by linking different computers to work with high processing and power.

6 0
3 years ago
HOW CAN A PERSON GET BENEFITTED BY THE ICT BASEDSERVICES PROVIDED BY GOVERNMENT
BARSIC [14]

Answer:

Explanation:

It aims to transform the entire ecosystem of public services through the use of information technology.ICT holds particular promise in areas of governance and public participation.  Age can use information to reduce corruption and increase government transparency, accountability, efficiency and so finally gud night guys and take care.

plz mark as brainliest

5 0
3 years ago
Where should you endorse a check
yKpoI14uk [10]
This is done by signing your name on the back of the left end of thecheck<span>. </span>You<span> can also limit who can cash it by specifying in your </span>endorsement<span> that it is only to be deposited into your specified account at Provident.</span>
5 0
3 years ago
Read 2 more answers
Other questions:
  • Your bank offers to lend you $114,400 at an 8.5% annual interest rate to start your new business. The terms require you to amort
    11·1 answer
  • In 2-3 sentences, describe a case where circuit-switching is better than packet-switching?
    9·1 answer
  • What practices will help you avoid sending out e-mail to the wrong person?
    15·1 answer
  • In an image citation, what piece of information is listed first?
    14·1 answer
  • Assuming a user enters 25 as input, what is the output of the following code snippet? int i = 0; Scanner in = new Scanner(System
    11·1 answer
  • What social media category allows users to publish content as posts but restricts the size of the post to a certain numbers of c
    8·1 answer
  • What target audience does your product serve?
    13·1 answer
  • True or false: in order to keep yourself and co workers safe, you must be able to recognize electrical hazards
    8·2 answers
  • Which is true about POP3 and IMAP for incoming email?
    14·1 answer
  • Can someone please tell me what I’m doing wrong ? Please and it’s due on Thursday!!
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!