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
sladkih [1.3K]
3 years ago
7

Three variables, x, y and z, supposedly hold strings of digits, suitable for converting to integers. Write code that converts th

ese to integers and print the sum of these three integers. However, if any variable has a value that cannot be converted to an integer, print out, the string "bad value(s) in: " followed by the names of the variables that have bad values (separated by spaces, in alphabetically ascending order). For example, if the values of x, y and z were respectively "3", "9", "2" then the number 14 would be printed; but if the values were "abc", "15", "boo" then the output would be: bad value(s) in: x z
Computers and Technology
1 answer:
sineoko [7]3 years ago
5 0

Answer:

Required code is given below:

Explanation:

x, y, z = "abc", "15", "boo"

errors = []

try:

   x = int(x)

except ValueError:

   errors.append('x')

try:

   y = int(y)

except ValueError:

   errors.append('y')

try:

   z = int(z)

except ValueError:

   errors.append('z')

if len(errors) == 0:

   print(x+y+z)

else:

   print('bad value(s) in: ' + ' '.join(errors))

You might be interested in
1
raketka [301]

1

they were crafted in stained-glass art in religious buildings

2

puzzle games

3

motion-capture devices (e.g., Kinect, WiiMote

4

puzzle

simulation

5 0
3 years ago
How do you take a picture on this app
damaskus [11]
The paper clip.

Hope this helped.

Can i have brainliest?
8 0
3 years ago
a 0.600 kg dynamics trolley has 1.5 kg load added. It is launched with a force of 10.n what is the acceleration
Anastaziya [24]

Answer:

acceleration = 4.76 m/s²

Explanation:

Given that"

the mass of the dynamic trolley = 0.6 kg

the mass of the load  = 1.5 kg

total mass = (0.6 + 1.5) kg = 2.1 kg

the force = 10 N

Thus;

using the formula of force which is;

Force = mass × acceleration

10 = 2.1  × acceleration

acceleration = 10/2.1

acceleration = 4.76 m/s²

7 0
2 years ago
One of the jobs of the webmaster are to create a website<br>true or false
Talja [164]

true is the correct answer

8 0
3 years ago
Read 2 more answers
Which is part of the dales process A customer retention B billing C cost planning D customer relations
serious [3.7K]

Answer:

D customer relations

Explanation:

A sales process is a term that describes a set of predetermined undertakings in which a salesperson perform in order to engage and put up with prospective buyer right from the first stage which is pre-approach to a closed sale.

The sale process involves the following steps:

1. Pre-approach

2. Approaching the customer

3. Determining the needs of customers

4. Introducing the product

5. Handling questions and objections

6. Closing the sale

7. Recommendation selling

8. Encouraging and follow up.

Hence, all the steps involved in the sales process deals with CUSTOMER RELATIONS. Therefore, the right answer is option D.

6 0
3 years ago
Other questions:
  • Identify possible advantages and disadvantages of using automatic withdrawal to pay bills
    12·2 answers
  • Structure for forloop?
    10·1 answer
  • Which field can be used to track the progress on tasks that a user has created?
    10·1 answer
  • What command limits structural changes, such as adding, deleting, or moving sheets, that can be made in a workbook?
    13·1 answer
  • "When you can control devices and appliances by apps installed on your smartphone or tablet, you are said to have"
    6·1 answer
  • Assume that a is an array of two or more integers, and that b and c are integers.
    13·1 answer
  • A systems flowchart:
    15·1 answer
  • Write assembly programs with the following I/O
    15·1 answer
  • Which of the following is a particularly useful feature of Microsoft PowerPoint and
    8·2 answers
  • Please help! first one to answer correctly gets brainliest and thanked
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!