I'm trying to write a function that turns a string of digits into an integer, the same as int(, for numbers zero or bigger. So, k ('0') should return 0, k ('1') should return 1, k ( '75') should return 75, k ('999') should return 999, and so on. So far, I have the following function: def k(d): a = 0 for n in d: a = return a But I don't know what to put instead of What should I replace with?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Select one:
O a.
a / 10 + int (n)
O b. a % 10 + n
О с. а // 10 +
int(n)
O d. (a « 1) | n
O e. (a « 1) | int(n)
Of.
a // 10 + n
a| int(n)
g.
a * 10 +
int(n)
Oi.
a * 10 + n
O j.
int(n)
a % 10 +
Ok.
int(n)
a +
OI.
a / 10 + n
O m. aln
n.
а + n
Transcribed Image Text:Select one: O a. a / 10 + int (n) O b. a % 10 + n О с. а // 10 + int(n) O d. (a « 1) | n O e. (a « 1) | int(n) Of. a // 10 + n a| int(n) g. a * 10 + int(n) Oi. a * 10 + n O j. int(n) a % 10 + Ok. int(n) a + OI. a / 10 + n O m. aln n. а + n
Question 28
I'm trying to write a function that turns a string of digits into an integer, the same as int(), for numbers zero or bigger.
Not yet
So, k ('0') should return 0, k ('1') should return 1, k ('75') should return 75, k ('999') should return 999, and so on.
answered
So far, I have the following function:
Marked out of
def k(d):
1.00
P Flag
a = 0
for n in d:
question
a =
return a
But I don't know what to put instead of
What should I replace
with?
Transcribed Image Text:Question 28 I'm trying to write a function that turns a string of digits into an integer, the same as int(), for numbers zero or bigger. Not yet So, k ('0') should return 0, k ('1') should return 1, k ('75') should return 75, k ('999') should return 999, and so on. answered So far, I have the following function: Marked out of def k(d): 1.00 P Flag a = 0 for n in d: question a = return a But I don't know what to put instead of What should I replace with?
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education