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
Name criteria used when selecting a printer
Anna007 [38]

- color or B/W

- Ink-Jet or Laser

- Just ink replacement or ink+print head replacement

- Supporting USB/Ethernet/Wifi

- Can print double sided yes/no

6 0
3 years ago
TIME REMAINING
Feliz [49]

Answer:

O be afraid and unsure of what the noise really is.

Explanation:

8 0
3 years ago
Read 2 more answers
My desktop has problems; my icons, taskbar, and background are missing. I always have to use task manager to refix it every time
skad [1K]
Maybe restart your computer?
4 0
3 years ago
An administrator needs to protect rive websites with SSL certificates Three of the websites have different domain names, and two
Marysya12 [62]

Answer:

Option A (One SAN certificate) is the right answer.

Explanation:

  • A vulnerability management certificate that permits many domain identities to be safeguarded by such a singular or unique certification, is considered a SAN certificate.
  • Though on the verge of replacing common as well as accepted security credentials with either of these de-facto certifications.

Other alternatives are not connected to the given scenario. Thus the above option is correct.

5 0
3 years ago
The following system is ideal for representing large, sparsely-populated tables that have a need for real-time, read-write rando
SVETLANKA909090 [29]

Answer:

The correct answer is C. HBase.

Explanation:

HBase is a database system written in the Java programming language. It is open-source and can store enormous amounts of data in tables in billions of rows and columns. It enables random read and write operations in real time. In HBase, the query fetch time is less. It is designed to store denormalized data in wide and sparsely populated tables in contrast to the relational database management system.

4 0
4 years ago
Other questions:
  • Suppose you develop an app and want to generate revenue but do not want to maintain the app. What would be your best choice?
    9·1 answer
  • Common icons found on the Windows desktop are _____.
    6·2 answers
  • Most network cards contain a port that accepts a(n) ____, which looks similar to a telephone connector but is larger.
    14·1 answer
  • Which software application should be used to communicate in writing about an upcoming event?
    12·2 answers
  • Your company wants to use an IoT device but wants to make sure it does not interfere with other RF devices that use the 2.4 GHz
    13·1 answer
  • C++ question:
    6·2 answers
  • Create two Lists, one is ArrayList and the other one is LinkedList and fill it using 10 state names (e.g., Texas). Sort the list
    6·1 answer
  • Please help with this
    8·1 answer
  • Supplies/material used in iron​
    11·1 answer
  • What episode and Season of Simpsons is this
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!