DEV Community

loading...
Cover image for Python Daily Problems on Edabit: Return a String as an Integer

Python Daily Problems on Edabit: Return a String as an Integer

abeck617 profile image Anthony Beckford🚀 ・1 min read

Edabit is a website where you can practice you problem solving skills. I'm using python but they have it for javascript as well

Problem: Create a function that takes a string and returns it as an integer.

Examples
string_int("6") ➞ 6

string_int("1000") ➞ 1000

string_int("12") ➞ 12

Solution:
def string_int(txt):
return int(txt)

Discussion (0)

pic
Editor guide