← Back to challenges

Return a String as an Integer

PythonEasystringsnumberslanguage_fundamentals

Instructions

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

Notes

  • All numbers will be whole.
  • All numbers will be positive.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Convert Age to Days