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
IgorC [24]
3 years ago
11

Exercise 9.2.9: Strings To Integers5 points

Computers and Technology
1 answer:
netineya [11]3 years ago
5 0

Answer:

x=input("Enter a String")

def safe_int(x):

   #lis1=[ int(x)if x.isdigit() else 0 for x in list_of_strings]

   lis1=[]

   lis1=x.split()

   print(lis1)

   flag=0

   j=0

   while(j in range(len(lis1))):

       if(lis1[j].isdigit()):

           flag==0

       else:

           flag==1

           try:

               if(int(lis1[j])):

                   lis1[j]=int(lis[j])

               else:

                   flag==1

                   break

           except:

               print("Cannot convert to integer")

       j+=1

   print(lis1)    

   

   

safe_int(x)

Explanation:

We are taking as an input a sentence, and then splitting it into various list items, and storing them in a list. Now we try to convert each item to integer and using try-except print the message cannot convert if its not possible or else converts it. As a check. enter 0 2 7 0   and also try Hello World.

You might be interested in
20 points
adoni [48]
Yes it's important. It's like taking jotting down the ideas you have for a project, you don't want to forget anything, and these things help you keep track of what you want to do.

Answer would be false.
4 0
3 years ago
Which type of network cover a large geographical area and usually consists of several smaller networks, which might use differen
nlexa [21]

Answer: WIDE AREA NETWORK (WAN)

Explanation: hopes this helps

7 0
3 years ago
On an XBOX 360, what does it mean if you get 4 red rings on your console?
Hitman42 [59]

Answer:

C. This happened to me.

Explanation:

4 0
3 years ago
Which tab on the Table Tools contextual tab is used to control the style and formatting of the table as it relates to colors for
laila [671]

Answer: The answer would be the "Home Tab"

Explanation:

4 0
3 years ago
For each of the users of accounting information, identify whether the user is an external decision maker (E) or an internal deci
jarptica [38.1K]

Answer:

Customer (E), Company manager (I), Internal Revenue Service (E), Lender (E), Investor (E), Controller (I), Cost accountant (I), SEC (E).

Explanation:

First of all, we need to define what exactly is an External Decision Maker (E) and an Internal Decision Maker (I).

External Decision Makers, these are people <u><em>outside the company</em></u><em> </em>that make decisions, for example: Customer, Internal Revenue Service, Lender, Investor and The U.S. Securities and Exchange Commission (SEC).

<u>Customers</u> are external because they don't belong to the company.

<u>Internal Revenue Service </u>is an institution of the  Government of the U.S., that's why is outside the company.

<u>Lender</u>, this person or financial institution is not involved in the company in self, only lends money to the company, that's it.

<u>Investor,</u> as it was said above, it's the person or institution that only lends the money to the company, without being part of the insides.

<u>The U.S. Securities and Exchange Commission (SEC)</u> is an institution of the U.S. Government, so it's outside the company.

Internal Decision Makers, these are people inside the company, they are absolutely involved in the direct decisions, for example, Company Manager, Controller and Cost Accountant.

<u>Company Manager</u> is the head of the company, the person in this position absolutely makes company decisions to coordinate all departments.

<u>Controller</u>, this person has the responsibility of all accounting related activities, that's why is an internal decision maker.

<u>Cost Accountant,</u> is an internal decision maker because is the person in this position has to be a financial specialist who determines costs of the products or services that the company offers.

So, there you have it, it's a pleasure to help.

4 0
3 years ago
Other questions:
  • Explain what mistake Miranda made in the following scenario. Situation: Miranda suspects that there may be a problem with the ha
    13·2 answers
  • Discuss why mtv initially had a difficulty securing enough ads
    10·1 answer
  • _____ remove the part of an image starting from an edge​
    13·1 answer
  • Which of the following best defines Monte Carlo simulation?a. It is a tool for building statistical models that characterize rel
    11·1 answer
  • Which of the following is NOT necessary for organizing data to make it easier to sort?
    6·1 answer
  • The camera still is bad even with the new iPhone xr and especially in low light it is even worst because you can see the pixels
    15·1 answer
  • All of these valid ways to earn money in microworkers except
    8·1 answer
  • What model involves the creation of data and process models during the development of an application
    14·1 answer
  • How to square a number in java.
    15·1 answer
  • Write a function called st_dev. st_dev should have one
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!