Computers and Technology
Computers and Technology, 26.02.2020 22:32, nick4524

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, crimhill
When is it appropriate to use an absolute reference
Answers: 1
image
Computers and Technology, 23.06.2019 03:30, natalie2sheffield
Hashtags serve to identify the topic of a given tweet true false
Answers: 2
image
Computers and Technology, 24.06.2019 02:50, rurbanok12
Be sure to answer all parts. synthesize the following compound from benzene. a. b. c. d. e. f. reaction [1] conditions: a b c d e f reaction [1] product: draw structure reaction [2] conditions: a b c d e f reaction [2] product: draw structure reaction [3] conditions: a b c d e f reaction [3] product:
Answers: 3
image
Computers and Technology, 24.06.2019 08:20, brinks7994
Which type of entity describes a fundamental business aspect of a database? a. linking b. lookup c. domain d. weak
Answers: 3
Do you know the correct answer?
PYTHON QUESTION

Exercise 9.2.9: Strings To Integers 6 points

Make a function...

Questions in other subjects: