subject

PYTHON QUESTION

Exercise 9.2.9: Strings To Integers 6 points

Make a function called safe_int that takes a single argument. This function

should try to convert the argument into an integer. If this succeeds, the

function should return that integer. Otherwise, the function should return 0.

Then, use this function in a list comprehension to create a list out of the

given list. The new list should contain either a O or the correct integer in

place of every string in the given list:

[0, 2, 7, 0]

Make sure to print out the resulting list.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, ladyree8721
Which of the following physical laws can make the flow of water seem more realistic? a. motion b. gravity c. fluid dynamics d. thermodynamics
Answers: 2
image
Computers and Technology, 23.06.2019 04:20, RandomLollipop
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
image
Computers and Technology, 23.06.2019 14:30, rose6038
Select the correct answer. peter has launched a website that features baby products. however, clients often find they are unable to access the website because the server is down. which feature of cybersecurity should peter focus on for his website? a. data authenticity b. data privacy c. data availability d. data integrity e. data encryption
Answers: 3
image
Computers and Technology, 24.06.2019 13:30, yola32
What is the most important for you to choose before you build a network?
Answers: 1
You know the right answer?
PYTHON QUESTION

Exercise 9.2.9: Strings To Integers 6 points

Make a function...

Questions in other subjects: