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
Read the following Selection Sort function and determine the correct answer for blank #2.
lakkis [162]

Answer:

Option(a) is the correct answer to the given fill in the blank of #2

Explanation:

The values[indexOfMin] returns the minimum element in the particular array As in the given question we have to implement the selection sorting .In the selection sorting we have choose the element and compare them others minimum index that's why we have choose the values[indexOfMin] function.

  • The index of min is not the correct function So we have not used in the given fill in the blanks that's why option(b) is incorrect .
  • The  values[startIndex] represent the starting index only that is not suitable for the given question that's why it is incorrect option.

4 0
3 years ago
In which view of PowerPoint is the Annotation tools menu available?
lara31 [8.8K]

Answer:

2.

Explanation:

Annotating in PowerPoint is the create notes while delivering a PowerPoint presentation. This could be done in two ways.

First, right click with the mouse and select 'pointer options'. Then you can choose either pen or highlighter to circle certain word or highlight any line.

The second way of creating annotation is by going to View→Normal→Notes.

After you select 'notes', a pane will appear at the bottom of your presentation.

So, the correct answer that annotation tools menu is available in Normal. Thus option 2 is correct.

7 0
2 years ago
Read 2 more answers
let's imagine you're searching for hotels in searching chicago, what should you search for in order to get the most relevant res
n200080 [17]

Trivago, Trip advisor,

3 0
3 years ago
What is the purpose of the fit to size feature in Word?
Olegator [25]

Answer : computer

Explanation:

please mark me as brilliant

3 0
2 years ago
In attempts to improve their contribution to the environment, a company decided to adapt to green computing. Which of these tech
timama [110]

Answer:

All of them apply

Explanation:

Green computing is the process of using environmental friendly computers and its associated components, accessories and other supporting devices.

Virtualization helps us to reduce the number of hardware that we are using.

Grid computers helps us to reduce the use of number of machines and thus supporting the environment in a right way.

Recycling process. Any material that we use needs to be recycled effectively and also in an environmental friendly way.

Autonomic computing uses eco-friendly system which in turn hugely support green computing.

8 0
3 years ago
Other questions:
  • When using the BinarySearch() method of an array or list type, what value is returned when the element is not found? How can we
    12·1 answer
  • Briefly describe the client/server model.
    8·1 answer
  • "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequen
    5·2 answers
  • The keywords used in programming languages that use decisions to redirect the flow of a program are called __
    13·1 answer
  • Why do TV shows/Movies from the 90's and early 2000s look so much different compared to today?
    7·1 answer
  • The famous study entitled ""Protection Analysis: Final Report"" focused on a project undertaken by ARPA to understand and detect
    14·1 answer
  • Cuántos tipos de grua existen en el mundo​
    7·1 answer
  • Manfred wants to include the equation for the area of a circle in his presentation. Which option should he choose?
    11·2 answers
  • Represent the measuring unit ofcomputer un terms of fration of second​
    13·1 answer
  • Example of language processor software
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!