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
You are late in the preparation of the computer graphics for your final report and presentation. You run into a friend who is gr
icang [17]

Answer:

Tactic Exchange

Explanation:

The approaching style of the student to his/her friend for help is of an influence categorized as the "Exchange Influence Tactic".

The Exchange Influence Tactic refers to when a person persuades someone or seeks influence over him/her by offering some sort of reward for their help rendered. It might also work by reminding other person of any favor which you offered in the past that should be repaid now.

Here the student is seeking help of his/her friend for completion of a final report for which he/she is already late. In exchange the student is assuring his/her friend the completion of certain spreadsheets which are pending on him/her. Hence, the student has used the exchange tactic to get his work done by offering a favor in response.

3 0
4 years ago
Identify the use of queue in the process of spooling output to a printer.
sashaice [31]

The queue makes sure the printer prints each sheet of paper in order.

6 0
3 years ago
The final step in the object-oriented design (ood) process consists of developing the?
kenny6666 [7]

The final step in the object-oriented design (OOD) process consists of developing the <u>package diagrams.</u>

<u></u>

In the field of Computer studies, object-oriented design (OOD) can be described as a design method in which a proper system of interacting objects is planned for making a computing system or software.

The final step of an object-oriented design (OOD) involves the development of package diagrams. Package diagrams are structures or diagrams that are used for representing the model elements. The model elements are shown as packages in this kind of diagram.

Package diagrams are the final step of an object-oriented design process because they help to provide a visual idea of the overall proposed design.

To learn more about object-oriented designs, click here:

brainly.com/question/13383471

#SPJ4

5 0
2 years ago
Edhesive 8.5 code Practice help me pls
Hoochie [10]

Answer:

twainQuotes = ['I have never let my schooling interfere with my education.', 'Get your facts first, and then you can distort them as much as you please.', "If you tell the truth, you don't have to remember anything.", 'The secret of getting ahead is getting started.', "Age is an issue of mind over matter. If you don't mind, it doesn't matter. "]

print(twainQuotes)

twainQuotes.sort()

print(twainQuotes)

twainQuotes.insert(1,'Courage is resistance to fear, mastery of fear, not absence of fear.' )

print(twainQuotes)

Explanation:

ok

3 0
3 years ago
7.3 Code Practice edhesive
sladkih [1.3K]

Answer:

def print_sum(a,b,c):

 print(a+b+c)

one = int(input("Enter the 1st number: "))

two = int(input("Enter the 2nd number: "))

three = int(input("Enter the 3rd number: "))

print_sum(one,two,three)

Explanation:

hope this helped :)

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which keyboard feature is a form feed character?
    14·1 answer
  • Why are prepositions, conjunctions, and pronouns usually considered poor choices to use as key words?
    5·2 answers
  • Put the steps of the decision-making process in the correct order.
    12·1 answer
  • It is possible to limit the search results to a range of publication dates.
    13·1 answer
  • You attempt to telnet to system 192.168.1.240. You receive the following message: "Connecting To 192.168.1.240...Could not open
    5·1 answer
  • 1. Which sentence best expresses the main idea
    12·1 answer
  • You are a network administrator for your company. The network consists of a single Active Directory domain. All servers run Wind
    7·1 answer
  • The higher the ____________________, the faster the ____________________.
    5·1 answer
  • Can someone take away your points
    15·1 answer
  • In 1980, IBM's cheapest computer was more affordable than Apple's.<br><br><br> True<br><br> False
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!