DEV Community

Cover image for Python Daily Problems on Edabit: Return a String as an Integer
Anthony Beckford🚀
Anthony Beckford🚀

Posted on

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

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)

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay